Sunday, January 5, 2014

Developing a flash game 05

Hi there guys...

I kind of had a little bit of time, so I added the logic required to make the character stand on tiles. Right now the character does not get affected by the tiles above or in front of it. Adding these will be done in the next update. For now check this work.

The x and y coordinates are mapped from character real values to map tile values by dividing them. In my case each tile uses 16 pixels, so x and y are divided by 16.

Next the tiles at location x,y are checked. If the character can stand on then then the Y acceleration is zero, otherwise the character is falling, i.e. the y acceleration get increased.


No comments:

Post a Comment