Physic help! when press attack button = enemy die, when attack button not pressed = life -1

@Brent: yes sir… i use it on widget…
the problem is… how to makes HP not -1 when i meet enemy with attack sprite mode…

i duno how to implemen that function :frowning:

Do you want to check if the player’s sprite animation sequence is equal to something (attacking or not attacking) to determine which action to take?

Brent

@Brent : yes sir… any template of that function?
i just confused a lot :frowning:

Hi @kali8pm,

During the collision, you can check which “sequence” is playing by using the “sprite.sequence” property. See here:

https://docs.coronalabs.com/api/type/SpriteObject/sequence.html
 

Brent

[lua]
local current_sequence = spriteObj.sequence
[/lua]

so i must write this??
[lua]
local attack = spriteObj.sequence
[/lua]

where i must put that code??
sry for my noobnest sir :frowning: