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?
Offline
Yes, painting over spots should work. You could either use the pen or change the pacman costume and use stamp.
Offline
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.
Offline
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
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.
Offline
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
Offline
It works
http://scratch.mit.edu/projects/Mayhem/8362
Offline