Hello friends,
Now i try to make platform wars game, like Cat War 2
I got the problem when player and enemy had collide or overlap,
I dont have an idea for implementing their attack animation with number of damage and number of attack speed (aspd)
And there are no idea for implementing if more than 1 player sprite and more than 1 enemy sprite had collide or overlap.
i want all player attack one enemy and all enemy attack one player
here is my simple algorithm :
1. if player collide or overlap with enemy, player and enemy are stop.
2. player do "Attack" animation, with delay per animation
3. enemy do "Attack" animation, with delay per animation
4. if player "Attack" animation is finished, player attack set to 1 and do "Walk" animation
5. if enemy "Attack" animation is finished, enemy attack set to 1 and do "Walk" animation
6. subs player HP with enemy attack
7. subs enemy HP with player attack
here is C2 simple algorithm :
=== General Event ===
System: Every tick ->
For each: player ->
For each: enemy ->
Player: collide with enemy -> Player: set speed 0
--- or --- -> Enemy: set speed 0
Player: overlap with enemy -> Player: substract Enemy.Attack from HP
-> Enemy: substract Player.Attack from HP
Every 3 second -> Player: set animation "Attack" (beginning)
Every 3 second -> Enemy: set animation "Attack" (beginning)
=== Player Event ===
System: Every tick ->
Player: is "Walk" animation playing -> Player: set attack to 0
Player: is "Attack" animation finished -> Player: set attack to 1
-> Player: set animation "Walk"
=== Enemy Event ===
System: Every tick ->
Enemy: is "Walk" animation playing -> Enemy: set attack to 0
Enemy: is "Attack" animation finished -> Enemy: set attack to 1
-> Enemy: set animation "Walk"
here is my troubles :
1. When 1 player collide or overlap with 2 enemy, 1 player attack to 2 enemy (should be attack to 1 enemy)
2. When 1 player collide or overlap with 1 enemy, player attack delay (attack speed) is faster than enemy attack delay (attack speed) whereas the attack delay for them are same
here is my simple .capx :
Collision Test.capx
Give me an idea or sample code please <img src="smileys/smiley2.gif" border="0" align="middle">
Thank you.
Regards,
YosuaLB