Skip to main content
Inspiring
June 30, 2008
Answered

hit detection

  • June 30, 2008
  • 2 replies
  • 369 views
i have included my code below for bullets in my game. the bullets are added to the stage when the mouse is clicked anywhere. easy enough... now the question i have is at the bottom of my shooter function. i am trying to detect when a bullet (boxr) hits my target.

it could have something to do with the bullets being generated inside that function and the target being just a movie clip on the stage with the instance name "target". im not sure. any help would be greatly appreciated.
This topic has been closed for replies.
Correct answer kglad
your hittest isn't in the enterframe listener function.

2 replies

kglad
Community Expert
Community Expert
July 1, 2008
no, as you now know your hittest to be repeatedly executed whenever boxr's position changes.
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 30, 2008
your hittest isn't in the enterframe listener function.
crilaAuthor
Inspiring
June 30, 2008
awesome! i didn't realize you had to detect for a hit each frame. i just thought it was triggered when the two movie clips were on top of each other. thanks!