# Noob question hitTest

**URL:** <https://forum.kirupa.com/t/noob-question-hittest/171315>\
**Category:** flash\
**Created:** [December 4, 2005, 4:41am UTC](https://forum.kirupa.com/t/noob-question-hittest/171315 "2005-12-04T04:41:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukasz48](https://avatars.discourse-cdn.com/v4/letter/l/f1d935/32.png) [@lukasz48](https://forum.kirupa.com/u/lukasz48)\
**Post date:** [December 4, 2005, 4:41am UTC](https://forum.kirupa.com/t/noob-question-hittest/171315/1 "2005-12-04T04:41:59Z")

</div>

This might seem like a realu simple question, but I’m having the hardest time on my flash assignement. anyways it’s a realy basic game. you have a pacman type figure, eating stars that come from the right of the screen randomly. so where I’m stuck is that I can not get me pacman figure to eat any of the duplicates, he only eats the original and I can’t the stars to constantly appear; they go accros the screen once and never return…  
my game is seperated in 3 layers for now, so I have the  
star layer  
pacman layer  
and backround layer

my sript is as follows  
on the star which is (redstar\_mc)

onClipEvent(enterFrame)  
{  
speed = 8;  
this.\_x -= speed;  
}

the pacman figure

onClipEvent (load)  
{  
moveit = 10;  
score=0;  
\_root.score\_txt.text=score;  
}  
onClipEvent (enterFrame)  
{

if(\_root.man\_mc.hitTest(\_root.redstar\_mc))  
{  
unloadMovie(\_root.redstar\_mc);  
score=score+5;  
\_root.score\_txt.text=score;  
}

if ((Key.isDown(Key.RIGHT)))  
{  
this.\_x += moveit;  
}  
else if ((Key.isDown(Key.LEFT)))  
{  
this.\_x -= moveit;  
}  
if ((Key.isDown(Key.DOWN)))  
{  
this.\_y += moveit;  
}  
else if ((Key.isDown(Key.UP)))  
{  
this.\_y -= moveit;  
}  
}  
and on the backround layer

count = 1;  
while (count\<5)  
{  
\_root.redstar\_mc.duplicateMovieClip(“star”+count, count);  
\_root[“star”+count].\_y = random(150);  
count += 1;  
}

so basically I just do not know what to do, I’ve been on it for the last 2 days…
