• Advertisement
  • entries
  • comments
  • views

Beads Maze

Sign in to follow this  


[font='times new roman'][color=rgb(0,0,0)]I decided to write a maze drawing program with cells shaped like donuts. So I first designed the appearance with a free CAD program. I like to start my projects with a very solid visual design because (1) appearance is important, especially in games, (2) I will have a point of reference while coding, and (3) a detailed picture may even suggest a new way to play the game.[/color][/font]


[color=rgb(0,0,0)][font='Times New Roman']Next I wrote the so-called OnDraw routine for an empty maze in PHP. When it comes to developing games, I like the bottom-up approach. I like to jump right into coding, get instant feedback, and design as I code. And I run IIS locally so that I don't have to upload my code to a remote server each time I make a code change. I also rely heavily on error_reporting(E_ALL); and error_log("x=$x\n",3,"output.txt"); for debugging.[/font][/color]


[color=rgb(0,0,0)][font='Times New Roman']Next I retrofitted an old maze drawing program for a square maze I wrote quite some time ago over the donut rings. This step took much longer than I anticipated for many reasons, one of which was that I could not comprehend it because almost all variables were single letter alphabets. My bad.[/font][/color]


[color=rgb(0,0,0)][font='Times New Roman']Then I constructed the walls inside the donuts based on the square maze. I was also trying to pick a good color for the walls. While visualizing what it would look like if every donut had a different color, I got the idea that I should call it beads maze. [/font][/color]


[color=rgb(0,0,0)][font='Times New Roman']While staring at the numbers I printed inside the small circles for debugging purpose, a great idea hit me -- why not show alphabets instead of numbers? When a player solves the maze properly, the letters he or she has visited will spell out a word or a sentence containing a secret message. What serendipity![/font][/color]


[color=rgb(0,0,0)][font='Times New Roman']Above is what the final program looks like. Please visit [/font][/color]http://www.puz.com/sw/phpmaze/index.php[color=rgb(0,0,0)][font='Times New Roman'] and try it out![/font][/color]

Sign in to follow this  


Recommended Comments

Man this is awesome! I really enjoy writing basic mechanics in php because of the ability to get instant feedback. I will have to leave another comment once I get a chance to try this thing out.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement