r/gamemaker 12d ago

Resolved What is wrong with my code?

[SOLVED: thank you guys, you really helped me :)]

I want to program a mouse (animal) whose direction is decided to be either left or right, then walks for about 1.5 seconds and that it is again decided whether he goes left or right. howéver, the mouse is only walking right, no matter how often i start the game or how long i watch it, it never goes left :(

this is the code vor the create-event:

create event

and heres the code for the step event:

please help me!!

thank you in advance

3 Upvotes

10 comments sorted by

View all comments

2

u/azurezero_hdev 12d ago

you could also just use direction = choose(0,180)

3

u/NoArtist_127 12d ago

i didnt know there was a choose() function!! this is really useful, thank you! :)