Beginner needs basic help please

I am a complete newbie to programming, so please forgive any bad coding methods. :slight_smile: I have two things I want to get right with my game, and I can’t figure out how to do them.

First, how to play my game: Push one of the arrow keys once to move the middle square in the direction of the same color bar. You score 10 points each time you do this correctly. If you push the square to the wrong color bar, the game ends.

What I can’t figure out:

  1. Why is my scoring not working?
  2. How do I get the PlayerBox object to move the same speed in all four directions? It seems to move slower going left and right than it does going up and down.

Also, if you have any suggestions on how to code the game more efficiently, please let me know. Thank you for your help.
simple-game.zip (7.45 KB)

You go back to the main scene everytime boxcount is equals to zero.
So your whole scene resets to initial values, so as your score.

You also cannot convert directly a number to a string. Don’t use VariableString for your score, but ToString(Variable()).

Ideally, you shouldn’t use the same linecodes over and over again. You should call them just once, and use a variable to des/activate their events.

Make an extensive use of subevents to organize your code, and make it less redundant.

Made some changes. Seems to work, but there’s still some coding to do to define the winning conditions (4 hits in this version).
color-slide-3.gdg (97.5 KB)

Thanks for your help and for your file. I understand how the organization of the code helps it more clear. Although, your modifications are not exactly what I want, they do help me learn. Merci.