The Box Maze - a shell for programmers to enhance!     

                 Wednesday, June 17, 2015

It occured to me that I might be able to create a game in Python using Turtle graphics to allow a user to use keys on the keyboard to guide the pen/turtle through a maze. This is the program I came up with. It uses the arrow keys (left, up, and right) to guide the pen. I found that code via Google. The part I wrote allows a programmer to put boxes (squares or rectangles) anywhere on the screen to create a maze.

The game is set up so that after the program draws the boxes, the player can guide the pen from (a) wherever it is put to start to (b) wherever the designer tells them to go. If they bump into any of the boxes on the screen, that box turns red and the game ends.   The player needs to navigatge from the starting position to the target position without bumping into any of the boxes

The final goal should be a box.

When the player hits a box, the game ends and reports how long he has been playing.

The idea is that people would compete to see who can go from the starting postion to the target box in the least time.

YOU, the programmer, can use boxes_1.py to create a set of boxes. Once you are satisfied, you can copy that code and use it to modify the game, turtle_game.py, to include your boxes and set the starting location for the pen/turtle. I suggest drawing the target box in a different color.

Here are the two Python programs:

boxes_1.py

box_maze_game.py