-
Actionscript 2 collison detection
HI,
I am trying to make a game where you are a Pacman type guy, with an ak-47, and i have enemies, but i want to know how to make something happen When you hit them, like you die or something.
The dude you are is called 'turret', and the enemies are callled 'enemy' (and randomly appear)
Thanks.
-
Senior Member
Code:
if(enemy[i].hitTest(turret))
{
enemy[i]._x = Math.random(400);
enemy[i]._y = Math.random(400);
turret.health-=5;
}
If you like me, add me to your friends list .
PS: looking for spriters and graphics artists for a RPG and an Arcade fighting project. If you can help out, please pm me!
My Arcade My Blog
Add me on twitter:
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|