Tag Archives: sprite

Sprite steps

Yesterday I was fixing a bug in walking sprite (player). For the current sprite (Scias, Breath of Fire IV) are required 7 images for the transaction between the tiles. See below:

500000300 500000306 500000305 500000304 500000303 500000302 500000301

Note that the first step is the player is stopped. The bug occurred when the player performed a distance of several tiles. In the transition between the intermediate tiles (ie, all except the first and last), the first image appeared. What I like is that while it is moving, this first image was not displayed.
Solution: movements between tiles are now performed in a loop of 1-6 (excluding the first image – the index 0). Thus, when the player finished his walk, he remained with the image 6 (as if he was still walking). Then I created a new type of direction of motion called “NOTHING” (in Portuguese, NENHUMA), associating it with the first image.

NORTE(0,-2,TipoMovimentoEnum.VERTICAL,0,1),
NORDESTE(0,-1,TipoMovimentoEnum.DIAGONAL,-1,1),
LESTE(1,0,TipoMovimentoEnum.HORIZONTAL,-1,0),
SUDESTE(0,1,TipoMovimentoEnum.DIAGONAL,-1,-1),
SUL(0,2,TipoMovimentoEnum.VERTICAL,0,-1),
SUDOESTE(-1,1,TipoMovimentoEnum.DIAGONAL,1,-1),
OESTE(-1,0,TipoMovimentoEnum.HORIZONTAL,1,0),
NOROESTE(-1,-1,TipoMovimentoEnum.DIAGONAL,1,1),
NENHUMA(0,0,TipoMovimentoEnum.NENHUM,0,0);

Finally, changed the pathfinding to include “NOTHING” at the end of the path found. Thus, the thread that executes the character’s movement will end a sequence of movements with “NOTHING”, showing the image of the player stopped.

Note: of course I’m only using these images for’m in the prototype stage. Soon I will draw my own images (in another post I talk about it).