User Control Panel
Advertisements

HELP US, HELP YOU!

Perl/Tk Tilebased Maze Game

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Jul 18, 2005 6:22 pm    Post subject: Perl/Tk Tilebased Maze Game Reply with quote

A couple weeks back when I was without Internet for a week, I got to messing around with Perl/Tk again and experimented with a tile-based maze game.

This maze game isn't fully playable. There's a first level which cannot be beaten, and the only way to "quit" the level is to get yourself killed just to start the level over.

Screenshots:


And of course, it has its bugs. One bug that I don't particularly care to fix, as this was just an experiment, is something I call the "Dead Zone". Here's a screenshot of that:

This area, when the player walks into it, the map on-screen stops updating until you exit the area, when the map will suddenly update to show your new position.

Bug List:
- The "Dead Zone"
- Blue spheres don't disappear when gotten (so you can get negative spheres remaining)
- Red door doesn't disappear when opened
- Goal says congrats on beating the level, then nothing.
- On the first step after the level is loaded, it takes longer to process the tiles to be shown than taking steps after that.

You'll probably need to install Tk::StatusBar from CPAN to test this.

I'm posting this so you can play around with it, get ideas, learn, etc. but since this was just an experiment there's not a whole lot of documentation for it.

Customization:
Quote:
sprites.dat contains sprite data, i.e. walls, spheres, doors, water, etc.

First you define the sprites by a symbol, and then define its name and functions below. All the supported functions are exampled. Below that part you define images, going by the names of each tile.

The tile named void is a reserved tile which must be there. On the screenshots, the void tiles are the black ones. These tiles are used when you get to a point on the stage where the boundaries are visible. All the tiles that aren't part of the level ("void" tiles) are shown using the graphic you had as "void"

The tile named man is also reserved. This tile is the game's internal representation of the player--the stickman. I don't know how the program would react to this one (or the void one) being deleted, if anyone wants to play around with that feel free.

001.map is the map for level 1. The level maps are just a bunch of symbols representing different objects (the one-character symbols defined in sprites.dat), and then information for where the player starts, how many spheres to collect, hint message, etc.

And of course you can just edit Maze.pl to make any additional changes you want.


Controls:
- Arrow keys to move stickman around.

What I intend to do is make a module for this, possibly along the lines of Tk::Games::TileBased[::Maze] which will be more object-oriented (not in module objects, but as each sprite being its own object, that would make it easier to for example have the blue spheres turn into normal floor tiles when contacted by the player).

And don't comment on the graphics, either, this was just an experiment and I didn't put the most time into them.

So if you want to check out what there is and play around with it, it can be downloaded at http://aichaos.com/download/link/maze/MazeGame.zip

[screenshots can be found at http://aichaos.com/download/link/maze/ incase they don't show up here]

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Mon Jul 18, 2005 6:26 pm    Post subject: Reply with quote

reminds me of an old game i played called "Chip's Challenge" http://members.chello.at/theodor.lauppert/games/chip.htm
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Mon Jul 18, 2005 6:44 pm    Post subject: Reply with quote

Great job Cer - looking forward to more TK games and products from others, as well as you. I might even venture into the unknown myself =]
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Jul 18, 2005 6:48 pm    Post subject: Reply with quote

mattaustin wrote:
reminds me of an old game i played called "Chip's Challenge" http://members.chello.at/theodor.lauppert/games/chip.htm


Yeah, I loved Chip's Challenge. Very Happy I had a level editor for it too.

Something else I want to try with Perl/Tk is having like a scrollable canvas without the scrollbar, so instead of going through and just popping tiles in, it would scroll from tile to tile smoothly... cuz the bad thing with Chip's Challenge was the frame-by-frameness of it, it can get pretty crazy sometimes.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group