How Random Babbling Becomes Corporate Policy (t3knomanser) wrote,
How Random Babbling Becomes Corporate Policy
t3knomanser

Things You Shouldn't Do With JavaScript

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.
Tags: javascript, programming
Subscribe

  • Strange Things People Say About Me (to my face)

    Recently, I've been at the center of a trend. That trend is complete strangers asking me "Are you ____?" A quick summary. For example: Are you…

  • Writer's Block: If I could find my way

    -10,000 years, at minimum. Tomorrow is always better than today, especially when you can't fact-check.

  • Bob Morlang

    When I was working at Tri-Mount, we had these camp trucks. They were army surplus, and while they could take a beating, they only sort of worked. And…

  • Post a new comment

    Error

    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded 

  • 0 comments