Friday, November 23, 2012 12:02 AMAnswerer
In this thread I'd like to introduce making of a maze game.
Latest version: Maze Game 1.56 (XHL585-5)
Maze 0.3 ... Published as a example of Graphical Challenge 3 in Challenge of the Month - August 2012.
Maze 1.2 ... Introduced as "Turtle Maze" in Small Basic Blog.
Maze Game 1.3b ... Published as game beta version.
Maze Game 1.56 ... Completed game version.
- Edited by Nonki TakahashiEditor Monday, December 03, 2012 3:10 PM
Friday, November 23, 2012 12:16 AMAnswerer
About Maze 1.2:
Maze 0.3 doesn't work properly in web browser with Silverlight. So, I rewrote it to work in browser and the output is Maze 1.2.
Maze 1.2 is a program just make a maze and resolve by itself using Turtle.
I received requests for this program via Small Basic Blog. That are:
- Can we have another button where the user gets to control the turtle? Maybe with the arrow keys?
- Maybe time the user so that we can compare top scores of times it took us to beat it?
- After the turtle finishes or we finish, could it refresh itself back to the beginning so that we could play again?
- Less important, but it would be interesting to add some more AI on that turtle when he tries to complete the maze (other than or in addition to the "turn right" method).
Then, I decided to revise this program as a maze game.
Friday, November 23, 2012 12:42 AMAnswerer
1. How to create or solve a maze?
There are many ideas in Wikipedia.
2. What are needed for Silverlight environment?
I wrote an article titled "Local (Small Basic IDE) vs Remote (Silverlight)" in a forum thread "Bugs to Fix for Version 1.1 (continued)".
3. Turtle disappears after clear
Turtle disappears after calling GraphicsWindow.Clear(). But we need GraphicsWindow.Clear() to remove lines drawn by Turtle. So, I think only the way to restart Turtle for the game is not to use pen of the Turtle.
4. How to control Turtle
I'd like to use arrow keys to control Turtle. Arrow keys are recognized by using GraphicsWindow.KeyDown = OnKeyDown. (OnKeyDown is a key event handling subroutine.)
5. How to save score
Score will be saved in setting file.
- Edited by Nonki TakahashiEditor Monday, December 03, 2012 3:12 PM
Friday, November 23, 2012 2:44 AMAnswerer
Create Another Turtle:
I'm going to make another turtle for human player. Following steps are plan to create it.
1. Make a program to show turtle.
' Show Turtle to Capture Turtle.Show() tx = Turtle.X ty = Turtle.Y s = 18 ' set frame size x1 = tx - s / 2 x2 = tx + s / 2 y1 = ty - s / 2 y2 = ty + s / 2 GraphicsWindow.BrushColor = "Gray" GraphicsWindow.PenWidth = 0 GraphicsWindow.FillRectangle(x1, y1, 1, s) ' draw frame GraphicsWindow.FillRectangle(x1, y1, s, 1) GraphicsWindow.FillRectangle(x2, y1, 1, s) GraphicsWindow.FillRectangle(x1, y2, s, 1) GraphicsWindow.FillRectangle(tx, y2, 1, s / 2) ' draw center GraphicsWindow.FillRectangle(x2, ty, s / 2, 1) GraphicsWindow.FillRectangle(tx, y1 - s / 2, 1, s / 2) GraphicsWindow.FillRectangle(x1 - s / 2, ty, s / 2, 1)
2. Capture original turtle using [Alt]+[Print Screen] key.
3. Create a bitmap of original turtle using Paint program.
4. Make a program to change turtle color. --> I made a tool (SDH367) for this.
5. Capture new turtle using [Alt]+[Print Screen] key.
6. Create a bitmap of another color turtle using Paint and GIMP2.
7. Use the bitmap as image shape. --> I made a sample program (CQV406-0).
- Edited by Nonki TakahashiEditor Wednesday, November 28, 2012 10:52 AM new turtle
Saturday, November 24, 2012 4:43 AMOwner
Sunday, November 25, 2012 11:44 PMAnswerer
Yes. I will rename Maze to Maze Game. Maze 1.2 in the gallery should be replaced by new one.
Monday, December 03, 2012 1:32 AMAnswerer
I published a game version of Maze as Maze Game 1.3b (PNC833-14).
This is still beta (not completed) and has following known issue.
- CPU's Turtle position is displayed.
- Score / record are not saved.
- Not working properly in browser.
You can control player's Turtle with arrow keys.
- Edited by Nonki TakahashiEditor Monday, December 03, 2012 3:04 PM
Monday, December 03, 2012 3:00 PMAnswerer
I published completed version as XHL585-5.
* In browser, click maze once before using arrow keys.
* In local, remove comment lines for File objects.
- Edited by Nonki TakahashiEditor Monday, December 03, 2012 3:03 PM *