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/
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