im working on a pacman clone for my first project, i can do all the movement and stuff, i will ask about the movement for ghosts later if i can't get it. the problem im having is with collision detection, i want the little dot to be hid when i touch it. i know i can do a broadcast thing for each one but that could get quite time consuming, plus i would need to make each dot its own sprite. is there a way i can get only the dot im touching to hide?
Offline
If the dots are part of the background and not a sprite, you could stamp over them with the background color. This would work best if you had all the dots located on an evenly spaced grid of coordinates so that you could sense the approximate position with the pacman sprite, then compute the grid coordinates of the dot and then broadcast a message to a stamping sprite that would come over and "erase" the dot. I hope that makes sense...let me know if you want a demo project uploaded.
Offline
Paddle2See wrote:
If the dots are part of the background and not a sprite, you could stamp over them with the background color. This would work best if you had all the dots located on an evenly spaced grid of coordinates so that you could sense the approximate position with the pacman sprite, then compute the grid coordinates of the dot and then broadcast a message to a stamping sprite that would come over and "erase" the dot. I hope that makes sense...let me know if you want a demo project uploaded.
or he could use dots of a specific colour
Offline
well i figured out how to do it, i tried doing just hide if touching, that didnt work, but if you put a repeat around it then it does. so i ended up with 2 scripts for each sprite (every time i duplicated its a new sprite)
script 1
when flag clicked:
show
script 2
when flag clicked:
forever if (touching pacman):
hide
it worked perfectly
Offline