Jump to content

  • Log In with Google      Sign In   
  • Create Account

Beads Maze

Posted by puz, 21 June 2013 · 699 views

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.
Posted Image

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.
Posted Image
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.
Posted Image
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.
Posted Image

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!
Posted Image
Above is what the final program looks like. Please visit http://www.puz.com/sw/phpmaze/index.php and try it out!

Really nice! This is what game design is all about smile.png

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.

Thank you for the feedbacks, Bacterius and Navyman.

June 2016 »

192021222324 25

Recent Entries

Recent Comments

Recent Entries

Recent Comments