2 Replies - 4122 Views - Last Post: 06 October 2012 - 07:10 AM

#1 HxC_Pokecore  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 29
  • Joined: 07-September 11

Hit test

Posted 03 September 2012 - 05:01 AM

So I'm making a street fighter style game, and the enemy is just an Movie Clip that moves with a motion tween, and the player is a movie clip controlled by the arrow keys. I've got that much done. I've also got the player able to kick/punch with x and z.

Now I'm planning on just doing a hit test and that takes health off the enemy, and if he hits you it's the same.

But I can't think of a way to determine who hits first.. Like, maybe if the player was in range of the enemy for one second, then he would attack or something? I'm not sure.

This game is for an assignment, most people are just doing mouse maze games and stuff, so the teacher doesn't expect anything too complex. We have to use Actionscript 2 by the way.

If someone could help me that'd be great. Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Replies To: Hit test

#2 1st Paradox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 30-September 12

Re: Hit test

Posted 30 September 2012 - 04:01 AM

I would advise you place another movieclip inside your player character positioned on the last frame of the punch for example and about the size of the fist. Then create a hitTest for that fist movieclip. you can then recreate this for the enemy mc.
Was This Post Helpful? 0
  • +
  • -

#3 Funkmachine  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 11
  • Joined: 06-September 12

Re: Hit test

Posted 06 October 2012 - 07:10 AM

create a global varible make it an int. when you hit the enemy change it to 1, when he hits you change it to 2. When you want to know who hit last check your global value, if its 1 you hit last if its 2 he hit last.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1