Moving down based on random numbers

In this piece of code:

In the bats are moving down section, it checks in a random range from one to 4, if the
random number is 3 it changes the bat mode text variable, and then the bat should move down.

I couldn’t find any problem with it. Do you see anything?

regards

I can see a problem with the event before the bat moving down section. When you create the bat_move , you aren’t setting the Random_Move_1 value. So chances are it is set to the default value of 0:

See in this image

even when I set a random number, I still have a problem!

Why?

Because you are setting the random_num_1 to 1 after the create, but checking if it’s 3 before moving the Bat_Move object. So it will never happen.


BTW, are you checking the value of Random_Num_1 twice? And and why set Bat_Mode to “Move_Down” in one event, and then check if Bat_Mode is “Move_Down” in the child event?

I couldn’t understand what you mean exactly. Can you please explain more?
What is your idea?
What should I do?

There isn’t any help?
No one Knows?

It’s Christmas and the holiday season. Replies will be a bit slower.


Maybe set it to 3 instead? It all depends on how you want the bats to behave.

I change the code to:

It seems the game now works. But I am not sure.
I want based on a random number the Random_Num_1 variable moves down.
This variable initializes with the number 5.

regards,