YesNoOk
avatar

Custom Sprite Shadow (Read 2756 times)

Started by Kreuzer, January 15, 2017, 10:35:03 pm
Share this topic:
Custom Sprite Shadow
#1  January 15, 2017, 10:35:03 pm
  • ****
    • Japan
Its a custom shadow that uses image/animation and follows player in X axis and stays on floor in Y axis.
All you need is a shadow sprite and animation 9900 that uses it.



State that controls the shadow:
Code:
;---------------------------------------------------------------------------
;H - Shadow
;
[Statedef 9900]
type    = S
movetype= I
physics = N
anim = 9900
sprpriority = -9900

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = 0+ceil(parent, pos X);sets shadow position to character's position X, you can adjust it with the number value on the left
y = 0

Create Helper sctrl under Statedef -3
Code:
[Statedef -3]

[State -3, Helper]
type = Helper
trigger1 = 1 && !numhelper(9900);spawns shadow if there is no shadow
helpertype = normal ;player
name = "shadow"
ID = 9900
stateno = 9900
pos = 0
postype = p1
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = -1
pausemovetime = -1