The way animations are played in Excalibur is non-intuitive
See original GitHub issueCurrently to play an animation you need to call addDrawing('animationName', anim)
setDrawing('animationName')
to play an animation, then the animation plays as a side effect.
Problems:
- No way of knowing when the animation is done
- It is ackward to script out an animation sequence
- addDrawing and setDrawing don’t scream “use me to animate”
- No way to have an “invisible” animation
Possible implementation
// internal animations collection
var MyActor extends ex.Actor {
someMethod() {
// returns a promise that is resolved when the animation is complete
this.animations('run').play().then(() => {
this.animations('jump');
});
}
}
actor.addAnimation('key', anim);
//alias
actor.add('key', anim)
// in the case of looping animations, the promise resolves when the animation is switched
var done = actor.animations('looping').play()
// the "done" promise resolved
// additionally the "play" animation can take an optional delay parameter
var newanimdon = actor.animations('explode').play(200)
// to stop the current animation, doing a "freeze frame" on the current animation.
// Resolving the promise of the current animation
actor.animations.stop()
// to have the drawing be invisible call
actor.animations.none();
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Animation | Excalibur.js Edge API Documentation
Animations allow you to display a series of images one after another, creating the illusion of change. Generally these images will come from...
Read more >Excalibur's Radial Blind "LoS" is going too far... - Warframes
For instance If Excal is behind a crate, enemies on the other side of the crate are not affected? That is a real...
Read more >Why are players so sensitive when discussing how ...
And I hope that player is having fun playing the content, regardless of their skill ... no character animation indicating 0 uptime, etc)....
Read more >Petition: Keep the Animation!~ - Page 4
Hello Rokien here with another petition! I hope everyone's Tuesday is going well! Mine was till I read: "While the animations were nice,...
Read more >Another thread about King Arthur
I attriubute this to his play difficulty and unintuitive play. Players here seem to play the game in such a way that it's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You could consider doing something like an
IPlayable
interface to keep these sorts of things in check.Closed by #1730