salut, j'ai fait ça en D&D :
for all ob_orc: if direction is larger than 0
for all ob_orc: if direction is smaller than 90
for all ob_orc: set the sprite to sp_orc_hd with subimage 0 and speed 1
for all ob_orc: if direction is larger than 90
for all ob_orc: if direction is smaller than 180
for all ob_orc: set the sprite to sp_orc_hg with subimage 0 and speed 1
for all ob_orc: if direction is larger than 180
for all ob_orc: if direction is smaller than 270
for all ob_orc: set the sprite to sp_orc_bg with subimage 0 and speed 1
for all ob_orc: if direction is larger than 270
for all ob_orc: if direction is smaller than 380
for all ob_orc: set the sprite to sp_orc_bd with subimage 0 and speed 1
le sprite se change bien, mais il ne s'anime pas... comment faire ?
Je l'ai mit dans step
EDIT :
Bah, finalement j'ai fait ça en GML et c'est fonctionnel...
- Code:
-
if direction > 0
if direction < 90
{
sprite_index=sp_orc_hd
}
else
if direction > 90
if direction < 180
{
sprite_index=sp_orc_hg
}
else
if direction > 180
if direction < 270
{
sprite_index=sp_orc_bg
}
else
if direction > 270
if direction < 380
{
sprite_index=sp_orc_bd
}