This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-09-05 23:24:16

gtoal
Scratcher
Registered: 2010-08-15
Posts: 26

retro-game 2-d maze game engine

Anyone interested in writing a pacman-like game (where sprites move around on a grid) is welcome to reuse the code I just posted from my 'Vac-Man' game http://scratch.mit.edu/projects/gtoal/1282991 .

This is my second attempt to do a maze game; I deleted the first one because I made some bad design decisions; I think I got this one right - the motion is smooth and the collision detection is accurate; and I'm pretty pleased with the way that it turns corners. (That part took a few tries to get right)

It's a shame that Scratch doesn't allow for comments; I've kept it as simple as I could but there are a few tricky bits that may need explanation.  Ask here if you're using the code and I'll explain anything you need to know.

There's only two pieces of code in the project that I'm not happy with, and I'm hoping you can help me with these: 1) there's a big array that's initialised in a loop and it takes way too long because each iteration causes a 1-frame delay, slowing down the startup of the game; and 2) I don't know how to print text to the screen so I'm displaying the score and a timer using the variable display facility.

Graham

Offline

 

#2 2010-09-05 23:39:52

JAMBAMtheSLAM
New Scratcher
Registered: 2010-09-03
Posts: 100+

Re: retro-game 2-d maze game engine

A nice and funny twist on an old classic.


http://i54.tinypic.com/2s7zwxs.png

Offline

 

#3 2010-09-05 23:59:15

gtoal
Scratcher
Registered: 2010-08-15
Posts: 26

Re: retro-game 2-d maze game engine

Say, does anyone know why sometimes games run slow in  some (but not all) browsers?  I forgot to mention that you may need to run this one in Scratch to get full speed.

Offline

 

Board footer