Tuesday, 13 October 2015

Monday, 5 October 2015

Add new modules/functions, gravity, climbing.

Since we don't want gravity or climbing all over the map/level, we can define areas where these things are active.

* Gravity area; when player is in this area or when player press jump button, gravity is activated.
When jumping (right before player leaves ground/floor), get players initial Y-pos, then check for colliding areas to land on, if none, return to inital Y-pos after doing jump cycle. This way we can have jump in x,y,z dimensional playing field.
Same goes for falling, if player is in gravity area and player is falling, just check for colliding sprites on the way down.

* Climbing area; when player is in this area, the player can climb a ladder/wall.

We can use sprites (opaque layered maybe) to define these areas, and then check for collision with the player sprite, if they collide then do actions/motions. Or we can define positions (x,y,width,height) on the map where these things are active.
Although sprites maybe easier to work with in case of editing and moving things around on the map, don't need to hardcode the positions.