Friday, March 22, 2013

Dangerous Flying Chairs

Sports can be so dangerous it seems, especialy future sports played out on your iPad.

flying dangerous chairs from Robert Toone on Vimeo.

Above is one of the enemies I have written for Hoop Fighter and I want to talk about some of the elements that went into this final incarnation.

The chair above when I first put it in was simly spinning across the floor, and that was just boring, it was also none threatening, and I wanted something threatening to liven up the level of the game this enemy is going to appear on. So throwing it in at you, as though an opposing player had urled the thing your way seemed a lot more fun and  exciting. Once I threw it in I detected when it hit my floor level and simply reversed the vertical velocity, only I dampened it 50% to make the next bounce up smaller than the last. This happened to be a nice value from a looks perspective. My gravity balanced with the amount of velocity I rmeoved seemed to give a nice look and feel (though of course not an accurate simulation at all).

Then I realised that the forward momentum also needed to be dampened because the friction of hitting the floor would slow that too. This time I experimented with a value that would work and ended up with a 40% dampeneing amount. With all the velocities now being dampened when hitting the ground the chair did what I wanted, so I simply had to alter the inital velocity values to get the chair to bounce in the right place to make me be able to jump it, but also have the chair land right in front of the player. The reason landing in front of the player was important was I wanted to fool the player into jumping a bit early, and as the chair lands in front and has it's velocities dampened, you can be fooled in this way.

Next up I had a problem that the chairs diminishing velocities made it stop just under my player character. Oh Noes, so I had to implement a minimum forwards velocity. Which worked surprisingly well to simply drag the chair off screen.

And that's my chair.

Da Voodoochief

No comments:

Post a Comment