# Someone PLEASE point me in the right direction ... game hit detection

**URL:** <https://forum.kirupa.com/t/someone-please-point-me-in-the-right-direction-game-hit-detection/320934>\
**Category:** flash\
**Created:** [April 6, 2011, 2:03am UTC](https://forum.kirupa.com/t/someone-please-point-me-in-the-right-direction-game-hit-detection/320934 "2011-04-06T02:03:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gLee](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@gLee](https://forum.kirupa.com/u/gLee)\
**Post date:** [April 6, 2011, 2:03am UTC](https://forum.kirupa.com/t/someone-please-point-me-in-the-right-direction-game-hit-detection/320934/1 "2011-04-06T02:03:55Z")

</div>

Hi I’m making a frame by frame sort of game in flash AS3.

At this point I’m trying to sort out my hit detection. What I’m trying to say is that a hit is when my char\_mc is NOT jumping on frame 5. The trace function kept returning a “hit” when I did jump on frame 5. Now I’m completely lost … especially after making the void a boolean on the checkJumpHit function. It keeps returning this error message that I have no idea how to solve.

function jumpChar():void  
{

char\_mc.frame\_mc.gotoAndStop(“jump”);  
isJumping = true;  
clearInterval(runID);  
landID = setTimeout(landChar,gameSpeed \* 2);  
checkJumpHit();

}

function checkJumpHit():boolean {  
switch (char\_mc.currentFrame) {  
case 1 :  
if (bar1\_mc.currentFrame==5) {  
trace(“hit”);  
return true;  
}  
break;  
case 2 :  
if (bar1\_mc.currentFrame==5) {  
trace(“hit”);  
return true;  
}  
break;  
}  
return false;  
}

This is my source file if it helps put the game in perspective:  
[http://opax.swin.edu.au/~7163312/HDMMD211/](http://opax.swin.edu.au/~7163312/HDMMD211/)

I’m not looking for anyone to do my work for me. I would just really appreciate it if someone would take the time to explain things to me so I can learn; I’m having a lot of trouble as I’m extremely new to action script.

Thank you 🙂
