jon889 Posted May 21, 2015 Share Posted May 21, 2015 I'm part of a group of students that is making a web based game, and the current suggestion is to use Unity and it's browser plugin to make that game. One of the advantages being that it can be compiled to run on any platform such as iOS. However I dislike the idea of forcing the user to install a plugin to play a simple 2D game. Are there any other benefits to using HTML5 over Unity? And also any guides to getting started (like which framework to use) Quote Link to comment Share on other sites More sharing options...
rich Posted May 21, 2015 Share Posted May 21, 2015 It depends entirely on the type of game you're making - Unity is perfect for lots of different things, and its visual editor will let you get something done really quickly. Also it rocks for 3D. If you intend for the game to be playable on the web at the end of it though then forget it. Unless you use the Unity WebGL export (still experimental, still device limited, still massive runtimes) then it won't work - the Unity plugin doesn't work in Chrome any more at all since they disabled NPAPI. spinnerbox, yahiko, d13 and 1 other 4 Quote Link to comment Share on other sites More sharing options...
d13 Posted May 21, 2015 Share Posted May 21, 2015 a web based gameThen it's HTML5.Unity seems at least a year or more away from being able to produce code that will run properly on the web. Quote Link to comment Share on other sites More sharing options...
druphoria Posted May 21, 2015 Share Posted May 21, 2015 Use the HTML5 game framework phaser.io. Extremely easy to use/learn and flexible enough to make basically any 2d game you can imagine. Check this link for tutorials:http://phaser.io/learn Quote Link to comment Share on other sites More sharing options...
jon889 Posted May 22, 2015 Author Share Posted May 22, 2015 We've looked at phaser, and our game has simple graphics, just geometric shapes, eg the player is a circle. So it seems better to draw this plain circle with code than a prerendered PNG, so that it can be scaled arbitrarily without pixelation. But I can't see how to draw a circle in Phaser that is also an object like a sprite. Ideally we need jelly-like physics, which also doesn't seem possible with Phaser, as it seems heavily based on sprites? Quote Link to comment Share on other sites More sharing options...
d13 Posted May 22, 2015 Share Posted May 22, 2015 jelly-like physicsCould you explain this? Quote Link to comment Share on other sites More sharing options...
spencerTL Posted May 22, 2015 Share Posted May 22, 2015 I presume it is soft body / non-rigid body physics like if a soft rubber box fell on the floor it would deform and bounce back into shape. I'be just done a quick search and couldn't see anything for this in js - I imagine it is too intensive as the tech stands at the moment. There were a couple of examples on you tube of unity doing it but I got the impression from a quick read that it was not part of its standard features. Quote Link to comment Share on other sites More sharing options...
jon889 Posted May 22, 2015 Author Share Posted May 22, 2015 I've seen a game called agar.io which has such physics, and it uses a canvas element to display the game, so it seems it is possible in HTML5? Quote Link to comment Share on other sites More sharing options...
spencerTL Posted May 22, 2015 Share Posted May 22, 2015 Sorry I didn't mean to suggest it isn't possible just that it is so demanding that there is probably only a limited amount of gameplay that could be built around it - making it more likely a sort it out yourself problem than one you can find an engine for. Certainly p2, box2d, ninja and arcade used in Phaser are all rigid body. If you look at the Wikipedia entry for soft body physics all of the engines it lists are high end c++ ones.I know that one way is to use a physics engine like box2d and use constraints on polygons to make them deformable. This, to me, seems more of a simulation of soft body physics than the real thing but may suit you. It is quite a manual process setting up the objects though as it is not the engine's purpose. An example I saw for this was on www.emmanueleferonato.com but used the AS3 version of box2d. It probably wouldn't be too difficult to convert though. This method looks to me the way agar.io does it as you can see the blobs are many sided polygons. They also never seem to quite settle which may be a problem and is probably a result of forcing a rigid body system to do a soft body systems work. It is probably a balancing act between enough vertices to look good but few enough to love some resources for game play.Apologies for not putting links. My old iPad refreshes the page if I change to another tab and I lose my post... I've found. Bloody iOS8 on an iPad2. Quote Link to comment Share on other sites More sharing options...
rich Posted May 23, 2015 Share Posted May 23, 2015 The most recent version of this Box2D library includes the Google Liquid Fun port: https://code.google.com/p/jsbox2d/ Warning: HUGE library, terrible mobile performance. Great on desktop Quote Link to comment Share on other sites More sharing options...
spinnerbox Posted May 24, 2015 Share Posted May 24, 2015 2D in Unity is layered 3D seen from top so actually there is no 2D in Unity. Therefore it has more things to keep in mind than in Phaser. Phaser is just plain JavaScript and you can enable 3D if needed. Open Notepad++/Firefox/Firebug and start coding Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.