I have a helper that bounce of each side of the screen. The issue is once it bounces off the right hand side of the screen and makes contact with the opponent, it will hit him more than once.
I think it's something stupid but I been on it for a while, no luck.
This is the code.
Spoiler, click to toggle visibilty
; hurt
[Statedef 1010]
type = A
physics = N
movetype = H
anim = 1005
velset = 0,0
facep2 =1
[State 1080, score]
type = parentvaradd
trigger1 = gethitvar(damage)
trigger1 = roundstate = 2
var(1) = 1
persistent = 0
[State 1070, damaged]
type = varadd
trigger1 = gethitvar(damage)
var(1) = -gethitvar(damage)
persistent = 0
[State 1070, life display]
type = parentvarset
trigger1 = gethitvar(damage)
var(5) = var(1)
persistent = 0
[State 1000, Sphere Bounce]
type = VelSet
trigger1 = (Facing = 1 && Vel X > 0) || (Facing = -1 && Vel X < 0)
trigger1 = ScreenPos X > 320
trigger2 = (Facing = -1 && Vel X > 0) || (Facing = 1 && Vel X < 0)
trigger2 = ScreenPos X < 0
X = -vel x
Y = -Vel Y
[State 1005, Gravity]
type = veladd
trigger1 = time >= 6
y = 0.35
[State 1005, Vel]
type = velset
trigger1 = !time
x = gethitvar(xvel) * facing
y = gethitvar(yvel)
[State 1005, Vel]
type = veladd
trigger1 = !time && enemyNear, MoveType != A
x = -.75
y = -5
[State 1000: Sphere Hit]
type = hitdef
trigger1 = !time
attr = A, NA
hitflag = MA-
guardflag =
animtype = hard
air.animtype = back
priority = 1, miss
damage = 0,0
;sparkno = 0
hitsound = 5, 4
ground.type = High
ground.slidetime = 10
ground.hittime = 10
ground.velocity = -7, 0
air.type = Low
air.animtype = back
air.velocity = -3, -2
fall.animtype = Back
fall = 0
fall.recover = 1
fall.recovertime = 0
kill = 0
getpower = 0, 0
givepower = 0, 0
ground.cornerpush.veloff = -10
[State 1005, End]
type = changestate
trigger1 = pos y > -vel y
value = 1006
If you don't understand anything, just reply.