Is it possible to make a browser game using plain HTML?
Is it possible to make the game in the browser-based divs
, <imgs>
, the HTML5, of CSS3 and good ole 'jQuery? According to this guy , browser rendering speed is very good these days and that's the only reason I even consider this option. Does his answer match making a game in vanilla HTML?
source to share
Yes. DHTML games have been around for over a decade, and HTML 5 provides some pretty advanced rendering with CANVAS
. Check out Microsoft's rendering examples for the IE engine to see the type of performance you can expect (some things work better than others). Most of them are very impressive).
Check out this little HTML 5 MMO and Illyriad project (which claims to be based on HTML 5).
Is it possible to write a game without an element CANVAS
? Visually, you will be limited, but the logic can still be tricky. The game engine should be based on high-performance structures, not DOM elements. For example, if you were calculating a collision in a 2D field, you can evaluate the matrix and redraw only the affected elements. You shouldn't be evaluating the position of DOM elements, as this will be very slow.
source to share
I don't quite understand what you mean by "Plain HTML" since you also mention HTML5. If you just mean what you can build in a browser without plugins, I would take a look at the work done in Canvas and SVG. An example that really changed my mind about what is possible is the CAKE library demo, which you can view here here . Unfortunately this is outside IE8 (not sure about IE9 and I can't test it where I am), but it works well on the iPad which amazed me.
source to share
Continuous use of the DOM is possible, but unlikely. I really wanted to do this, so I was thinking about using jQuery jQuery jQuery to move elements around and perform collision detection, ect ... It would be nice to see a game using strickly dom and javascript elements.
If you've ever played anyone who moved blocks to solve a puzzle game (I don't know what they are called for, but I'm sure it's something like "Locked") it would be very possible with strictly Div and Javascript elements and I will applaud you for such maneuvers.
source to share
Yes and no.
Most games like Angry Birds, Fieldrunners, etc. use what is called "HTML5" when they use a new tag canvas
.
Using the DOM to create a game is not possible (unless you write pong and else ...). The DOM is too slow.
The canvas is an element that you can manipulate by painting on a bitmap. In javascript.
You should read this answer to understand the choice of API and use it depending on your use case (DOM vs Canvas vs SVG).
source to share