Saturday, April 6, 2013

Level Design

I got the basics of the game complete so far. I have an objective to collect the diamond, movement, and way of game over by hitting the spikes done.

All I had to do was add the diamond and spikes with collision. Collision is all handled by the below JavaScript function.

function overlapTest(a, b) {
    return a.x < b.x + b.w && a.x + a.w > b.x &&
         a.y < b.y + b.h && a.y + a.h > b.y
}

No comments:

Post a Comment