Log in

No account? Create an account

t3knomanser's Fustian Deposits

Things You Shouldn't Do With JavaScript

How Random Babbling Becomes Corporate Policy

run the fuck away

Mad science gone horribly, horribly wrong(or right).

Things You Shouldn't Do With JavaScript

Previous Entry Share Next Entry
I'll do a breakdown of the code later, but for shits and giggles, I thought to myself: "What was XHTML and JavaScript never meant to do?"

Well, to be fair, making video games isn't what it's for. People have made games like this before- although the most compelling example I've seen used SVG, not XHTML. This one's a little buggy, mostly in the wall handling. Sometimes, the ball hits the wall and stops. Something about the current horizontal motion vector- or so I think.

But essentially, the game is masturbatory pong- you control both paddles with your mouse. All of the game sprites are implemented as absolutely positioned DIVs that contain images. While this application doesn't use it, it's possible to animate the sprites, as well as have multiple frame sets- collections of frames that are grouped. This means I can have on set of frames for a character walking to the left, the right, etc.

When I have godawful amounts of time, I will probably implement a simple platform game in JavaScript and XHTML, simply because I can. There's no good reason to do it in XHTML- SVG is far better suited to it, but I like the idea of really fucking with the HTML DOM.
Powered by LiveJournal.com