• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Trigger a flag each X pixels ?

M

MathieuG89

Guest
I have an instance that moves from point A ( x = 0 ) to point B ( x = 640 ) at a 2 pixel speed and I would like a flag to trigger each time it reaches a 64 pixel length (0, 64, 128, 192, 256, 320, etc...) until it reaches it's final destination. I am probably over thinking this too much but I just can't wrap my head around how to do it... I would appreciate some insight thanks!
 
M

MathieuG89

Guest
In Step Event:
Code:
if x mod 64 == 0 {
    //Trigger that thing
}
I've spent about a hour trying to figure it out and here you are a minute after I posted my question with the simplest of solutions... thank you good sir!
 

TheouAegis

Member
If you want it to start from an arbitrary coordinate and every 64 steps (horizontally), then replace x with (x - xprevious).
 
Top