spx
spx copied to clipboard
(Costume-group) Animation issues
Project: animation.zip
For sprite Fighter
:
Config:
{
"fAnimations": {
"fight": {
"from": "__animation_fight_attack_1-1",
"to": "__animation_fight_attack_1-4",
"duration": 0.4,
"anitype": 0
},
"dying": {
"from": "__animation_dying_dead-1",
"to": "__animation_dying_dead-3",
"duration": 0.6,
"anitype": 0
},
"walk": {
"from": "__animation_walk_walk-1",
"to": "__animation_walk_walk-8",
"duration": 0.8,
"anitype": 0
},
"default": {
"from": "__animation_default_idle-1",
"to": "__animation_default_idle-6",
"duration": 0.6,
"anitype": 0
}
},
"defaultAnimation": "default",
"animBindings": {
"die": "dying",
"step": "walk"
}
}
Code:
onKey KeyUp, => {
say "animate fight", 0.3
animate "fight"
}
onKey KeyDown, => {
say "die", 0.3
die
}
onKey KeyLeft, => {
say "step left"
setRotationStyle LeftRight
turnTo Left
step 50
}
onKey KeyRight, => {
say "step right"
setRotationStyle LeftRight
turnTo Right
step 50
}
There are some issues:
-
The animation
default
(which is bound asdefaultAnimation
) is played only once while sprite in default state. It is expecetd to be played repeatedly (see details in https://github.com/goplus/builder/issues/603#issuecomment-2180367864) -
After animation
fight
(played by callinganimate "fight"
) finished playing, the sprite does not return to the default state, while it keeps the last csotume of animationfight
-
If we call
step 50
, it is expected to play animationwalk
(which is bound to statestep
). However, the sprite playsfight
, and thendie
, and thenwalk
, and then panic:panic: invalid costume index [recovered] panic: invalid costume index