Flash Actionscript: Game Damage Transfer
Hello ive provided a picture to try to better explain a complication i've been having:
What i would liek to do is so when SPCAEBAR is pressed, if these two smaller boxes are overlapping, the ememy will loose 10 damage
im sure there are many ways to do this, but im not trying to get into anything too complicated, i just want the yellow guy to take 10 damage everytime teh space is pressed, given the conditions
please help im desperate :)
Assume your Movie clips (MC) are like above. You have made a hit area MC and pull that onto your player MC. Now to check collision is easy.
if (player.playerHitArea.hitTest(enemy.enemyHitArea)){//do something}
Here is the source to a flash game I made while learning flash that using this same way to dectect hits.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement