• 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!

Change function?

W

Winsterpin

Guest
Hi sorry for a bit of the beginner question but I've been stumped. Is there a function in gm or one I can make where something happens every time the set value is changed? For example I would like to add one to my array every time my character changes direction. Any tips or wisdom from the more educated programmers?
Thanks!
 
Wherever you change the direction, update the array. To make it easier, you could just have an update script that does both and then you just call the script instead. However, it all depends on how your engine is set up, so the first option may be the more viable one.
 
W

Winsterpin

Guest
That's so simple I can't believe I didn't think of that! Thanks so much!
 
Top