Need help for making a maze game!

I'm currently making a maze game. My requirement of the game is that make a function 'touch_colour' so that the player can detect the colour of the wall to prevent colliding with the wall; also with procedures 'move_up', 'move_down', 'move_left' and 'move_right' to let the player move in directions.
Here is a screenshot of my initialized coding of the maze game.

And here is the designer of the maze game.

Actually, I'm just confused of the movement, directions and detection of colour of the player. As this game is a selected assignment that I must do, and today is the deadline, so I hope you can reply me! Thanks so much!

Why is this urgent ?

1 Like

Oh, it's because the deadline of the assignment is today at 11:59 am!!!

Please - I hope you can help me find a solution! Currently, my sprite doesn't move anymore in the Companion. I don't know why, but I'm sure it's related to my coding. I hope someone can tell me whether my codes are right or not. Thanks.


You have been regularly saving an aia or saving earlier versions of your Project? Load the aia of a previous version of your app that worked. Load the version that works and go on from there.

If you do not have an aia, try to remember the last few changes you made to your app and delete that code.

Without a working version of your code Blocks, it is doubtful anyone can figure out your issue by inspection of the code alone.

For what it is worth, I suspect your Touch_color Procedure does nothing (evaluate but ignore result) when you call it. Also your images, when captured the way you did it, are difficult to read .. use the AI2 feature to capture a Block image. Right-mouse click on a white space in the Blocks editor, "save Blocks as Image"

Sprite not moving? So an issue with your move_right..move_left etc Procedures?

Okay. I'll share the project to you guys, but I hope that you should not edit it without prior permission. Thanks for your understanding! MazeGame_2C_07 (1).aia (43.0 KB)

It's the newest version of my code. It may be different to the coding that I have mentioned in this post.

Disable your Stopwatch and you can move your Player1 sprite just fine.
Do not press Start, just disable the Clock and your app 'works'

If the Clock is running, the app crashes after a few seconds of running the counter and the Player1 cannot move.

Using Drag is nice but for what it is worth you might create a 'joystick' ... this code moves the Player1 a lot smoother ...zzzzz

Good luck. Perhaps this information will help you fix your app. :slight_smile:

Thank you so much for your reply!!! :smiley:
I have tried and it worked for me :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.