Slow_Motion Posted October 3, 2009 Report Share Posted October 3, 2009 Here is my code for walking if global.action=2{suck=0sprite_index=Kirby_Walkif xdir=1{hspeed=2}else{hspeed=-2}}[/CODE]I changed it to this[CODE]if global.action=2{suck=0sprite_index=Kirby_Walkif xdir=1{hspeed=2alarm[1] = 20}else{hspeed=-2alarm[1] = 20}}[/CODE]In alarm 1 I put[CODE]suck=0sprite_index=Kirby_Runif xdir=1{hspeed=5}else{hspeed=-5}[/CODE]Didn't work.... What am I doing wrong? What I want is if my "player" walks for a certain amount of time he starts running. Link to comment Share on other sites More sharing options...
USC Posted October 5, 2009 Report Share Posted October 5, 2009 Hmm...maybe it's because the 'hspeed = 2' is overriding what's happening when the alarm is triggered. Try making it conditional, like so... boolean running = false if global.action=2 {suck=0 sprite_index=Kirby_Walk if xdir=1 {if running = false {hspeed=2} alarm[1] = 20} else {if running = false {hspeed=-2} alarm[1] = 20} } suck=0 sprite_index=Kirby_Run running = true if xdir=1 {hspeed=5} else {hspeed=-5} ...or something along those lines. Hope that helps; I'm not too knowledgeable about GM syntax. Link to comment Share on other sites More sharing options...
Recommended Posts