hey friends I used a helper code as a projectile and I wanted to add an animation to the enemy char when it gets hurt by the projectile. I wanted the animation to stick on the enemy even if he gets pushed back or falls. How could I code something like this.
Question
Sweets
hey friends I used a helper code as a projectile and I wanted to add an animation to the enemy char when it gets hurt by the projectile. I wanted the animation to stick on the enemy even if he gets pushed back or falls. How could I code something like this.
heres what I got so far.
my char animation
[statedef 220]
type = a
movetype= a
physics = n
ctrl = 0
anim = 220
sprpriority = 1
[State 500, 1]
type = Helper
trigger1 =animelem= 14
stateno = 229
pos = 10,-28
postype = p1
ownpal = 1
supermovetime = 0
pausemovetime = 0
[state 220, 2]
type = playsnd
trigger1 = time = 2
value = 0,4
[state 220, 3]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;my actual helper
[statedef 229]
type = a
movetype= A
physics = n
ctrl = 0
anim = 230 ;this is the projectile animetion
sprpriority = 2
velset = 1.8,-.08
[State hitdef]
type = HitDef
trigger1 = time=0
attr = S, NP
hitflag = maf
animtype = Medium
damage = 30,0
guardflag = MA
pausetime = 1,15
sparkno = s1
hitsound = s5,2
guardsound = s6,0
ground.type = high
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -2.7,-3
air.velocity = -4,3
[State 229, 3]
type = ChangeState
trigger1 = movecontact
trigger2 = vel y > 0
trigger2 = pos y > -vel y
value = 223
;-------------------------------------------------
;my exploding animation
[statedef 223]
type = A
movetype= A
physics = n
anim =300
ctrl = 0
sprpriority = 2
velset = 0,0
[state safe pos ground]
type = posset
trigger1 = !time
trigger1 = pos y > 0
y = 0
[State end]
type = DestroySelf
trigger1 = !animtime
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now