|
Post by Admin on Aug 2, 2017 13:38:34 GMT
**By jlynes **
My first game project is just about wrapped up, I’ll announce it on here when it hits on Google Play, big thank you to everyone here for the assistance as I’ve been learning this engine.
Now for the question:
I’ve set up an animation timer for a sprite sheet and I’m calling it back with:
ETHEntity@ hamster = SeekEntity(“hamster.ent”);
FrameTimer@ frameTimer;
hamster.GetObject(“frameTimer”, @frametimer);
frameTimer.update(0, 1,0);
const uint currentFrame = frameTimer.getCurrentFrame();
hamster.SetUInt(“directionLine”, 0);
hamster.SetFrame(currentFrame, hamster.GetUInt(“directionLine”));
it works…however, in my last game it played through on repeat. For this one, I’m wanting the animation to play on a button press and end when another objects velocity is zero. I have the general idea of how that’s going to work, but when I push the button the sprite sheet just advances 1 frame instead of playing. Any ideas why?
|
|
|
Post by Admin on Aug 2, 2017 13:39:51 GMT
** By Kraemer **
Probably your animation method is being called only when you click the button, you have to put it into some repetition callback.
Something like …
loopMethod () { if (clicked button) animation (); }
animation () { // Your animation algorithm }
|
|