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

#1 2007-05-29 08:41:13

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Pacman Dots

Looking at a pacman style game, the obvious way to do the dots would be with every dot being a sprite.

But -

Has anyone tried it with the dots painted onto the background?

You then have a "spot" in the middle of the pacman of a certain colour, slightly smaller than the dot.

A script on the pacman detects if the pacman's spot is over the dot (probably by checking that it is *not* touching the background maze colour) and if it is:

1) Paint over the dot in the same colour as the background
2) run whatever script eating a dot reqires (+1 to score, sound effect)

Think that would work?


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#2 2007-05-29 13:01:18

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Pacman Dots

Yes, painting over spots should work.  You could either use the pen or change the pacman costume and use stamp.

Offline

 

#3 2007-05-29 14:43:22

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Pacman Dots

The main problem I can see is that it will require the pacman to be pretty accurately tied to the grid - something my current pacman (based on the Pacman that comes with scratch) isn't.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#4 2007-05-29 15:25:15

weissjd
Scratcher
Registered: 2007-05-16
Posts: 64

Re: Pacman Dots

You should be able to work around that. Try making the pen the width of your pacman sprite and doing a pen down/pen up. Or you could create a second sprite that's a rectangle the color of your background and the width of your PacMan. Move it to the location of your PacMan and stamp. You can experiment with the other dimension to make sure it hits one and only one dot each time.

Offline

 

#5 2007-05-29 15:37:46

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Pacman Dots

The current pacman, whose movement is only limited by his whisker not touching black, can overlap the maze walls, thats the trouble.

Stamping in that fashion would stamp on top of the walls.

I'd need to script his movement so that he has to be dead square on the path before turning - without making it too hard tomake the turn.

I think it would still be worth doing - certainly easier than putting 50 or so dot sprites around the maze.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#6 2007-05-29 17:05:55

weissjd
Scratcher
Registered: 2007-05-16
Posts: 64

Re: Pacman Dots

Ideally you'd want to fix that. You could have a border between the maze and the background in a slightly different color. Or you could make the pen size a little smaller than the pacman sprite to avoid stamping the edge of the maze.

Or you could let the pacman stamp out bits of the maze wall and make some kind of pacman/dig-dug hybrid  smile

Offline

 

#7 2007-05-30 12:41:01

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Pacman Dots

It works  big_smile

http://scratch.mit.edu/projects/Mayhem/8362


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

Board footer