S
space fable
Guest
hi guys, i have a object. this object must go in a specific point. to go in this point it needs avoid other object. i do it with pathfinding everything works.
I have a problem with change sprite.
The object have a different sprite for every direction.3 change sprite work good but when object go to left, give me the sprite to go to right.
Someone can help me?
That's the code. It is all in step event
I have a problem with change sprite.
The object have a different sprite for every direction.3 change sprite work good but when object go to left, give me the sprite to go to right.
Someone can help me?
That's the code. It is all in step event
Code:
grid=mp_grid_create(0,0,room_width/72,room_height/92,72,92);
path=path_add();
mp_grid_add_instances(path,wall,true);
mp_grid_path(grid,path,x,y,1024,720,true);
path_start(path,3,"",1);
if direction=90 {sprite_index=spriteUP}
if direction=0 {sprite_index=spriteRIGHT}
if direction=270 {sprite_index=spriteDOWN}
if direction=180 {sprite_index=spriteLEFT}