08-31-2015, 10:00 PM
(08-31-2015, 07:57 PM)Mat(Nerah) Wrote: You could try something like this to advance your event check ig: player's vspeed=0 so he is idleI'll certainly give it a shot in the morning, though I'm hesitant to use it if it does work. I'd prefer not to use speed checks to define states, as this can lead to screwynes when moving platforms get involved. Or i may be overthinking it and it might not cause any issue.
(Then you might be able to condense your armor switch code as well as the normal sprites, based on movement variables)
If you give me your variables I could edit this code more for you.
though this may be plug and play; fair warning please back up before trying this. Though the code has no syntax errors.
Code://Idle
if armor=1 && vspeed=0
then sprite_index=spr_valo_idle{sprite_index=spr_toroarmor_idle}
if armor=1 && hspeed=0
then sprite_index=spr_valo_idle{sprite_index=spr_toroarmor_idle}
//Jumping (Rising/Falling)
if armor=1 && vspeed<1 or vspeed>-1
then sprite_index=spr_valo_jump{sprite_index=spr_toroarmor_jump}
//Backflip
if armor=1 && backflip=true
then sprite_index=spr_valo_backflip{sprite_index=spr_toroarmor_backflip}
if armor=1 && backflip=false
then sprite_index=spr_valo_idle{sprite_index=spr_toroarmor_idle}
//Shooting
if armor=1 && shooting=true
then sprite_index=spr_valo_shoot{sprite_index=spr_toroarmor_shoot}
if armor=1 && shooting=true && hspeed<0 or hspeed>0
then sprite_index=spr_valo_run_shoot{sprite_index=spr_toroarmor_run_shoot}
//Running
if armor=1 && hspeed<3 or hspeed>-3
then sprite_index=spr_valo_run{sprite_index=spr_toroarmor_run}
//Walking
if armor=1 && hspeed<=1 or hspeed>=1
then sprite_index=spr_valo_walk{sprite_index=spr_toroarmor_walk}
//Draw our player
draw_sprite_ext(sprite_index,image_index,x,y,flipped,image_yscale,image_angle,image_blend,image_alpha)
Hope this may help, even if you don't use it you could learn from it. You seem to be a promising coder ^-^