Mihai Vasile
Member
Hey guys,
I am trying to add animation for some characters that are not controlled directly by the player. I am using the following:
In create :
alarm[0] = room_speed * 0.1;
xx = x;
yy = y;
In step:
if (x > xx) {sprite_index = spr_enemyleft;}
if (x < xx) {sprite_index = spr_enemyright;}
if (y < yy) {sprite_index = spr_enemydown;}
if (y > yy) {sprite_index = spr_enemyup;}
Alarm[0]
alarm[0] = room_speed * 0.1;
xx = x;
yy = y;
It is working but the delay between sprite changes is much higher than I was hoping for meaning it doesn`t look all that good. What am I missing ? Frame rate is set to 60 so alarm should trigger well before it seems it does.
I am also open to other systems of animation if you guys have suggestions with the one mention that I really don`t need something complex as I am not planning a lot of animations per character.
Thank you in advance!
I am trying to add animation for some characters that are not controlled directly by the player. I am using the following:
In create :
alarm[0] = room_speed * 0.1;
xx = x;
yy = y;
In step:
if (x > xx) {sprite_index = spr_enemyleft;}
if (x < xx) {sprite_index = spr_enemyright;}
if (y < yy) {sprite_index = spr_enemydown;}
if (y > yy) {sprite_index = spr_enemyup;}
Alarm[0]
alarm[0] = room_speed * 0.1;
xx = x;
yy = y;
It is working but the delay between sprite changes is much higher than I was hoping for meaning it doesn`t look all that good. What am I missing ? Frame rate is set to 60 so alarm should trigger well before it seems it does.
I am also open to other systems of animation if you guys have suggestions with the one mention that I really don`t need something complex as I am not planning a lot of animations per character.
Thank you in advance!