The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => Code Library => Topic started by: Kreuzer on January 15, 2017, 10:35:03 PM

Title: Custom Sprite Shadow
Post by: Kreuzer on January 15, 2017, 10:35:03 PM
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.

(http://i.imgur.com/CiAaVLm.png)

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
Title: Re: Custom Sprite Shadow
Post by: Ryon on December 11, 2018, 05:55:39 AM
is x = 0+ceil(parent, pos X) nessesary?

Wouldn't x = parent, pos x

be enough?