DĂ©c 012013

XNA and FPE is nice to play with.

This time lets start a platform game : an animated character jumping from one platform to another, collecting gems, in a wold of physics.

Some interesting point to note :

1-when my character is walking on tiles, the engine detects a collision at each edge, blocking my character 🙁
mad googling around, it seems i should :
-use joints : does not work
-use shapes : did not test it yet
-use multiple fixture for one bigger body : did not test it yet

For now, i create a circle for each tile instead of rectangles, it does mitigate (a lot) that bug : it is mostly invisible to the human eye (we see only the texture remember, not a body).

2-We want the character to jump only when touching the top of the tile, not the sides (or bottom).
Also, we dont want the character to jump while in the air.
There I have applied what seems the most common trick : a feet sensor, an extra body (not drawn) joined to my character (below) thru JointFactory.CreateWeldJoint.
When « feet » will collide with « floor » then isjumping=false else isjumping=true

3-The scenery is automatically generated from a text file (= a level) : level .
A level editor could come later.

As a whole, this is far from being perfect yet : the user/gamer experience is not optimal yet but still, I believe it is a good start 🙂

The video.

The source code.


 Posted by at 18 h 41 min

Poster un Commentaire

Me notifier des