New function to only change beginFrame

This commit is contained in:
Jorim Tielemans 2019-08-01 23:01:03 +02:00
parent f353c89172
commit e96cbc97b4
1 changed files with 5 additions and 5 deletions

View File

@ -79,14 +79,14 @@ public:
animate(); animate();
} }
void makeAnimated(int beginFrame, int numberOfFrames, int animationDelay) { void makeAnimated(int beginFrame, int numberOfFrames, int animationDelay) {
this->numberOfFrames = numberOfFrames; setBeginFrame(beginFrame);
this->animationDelay = animationDelay; animateToFrame(beginFrame);
this->beginFrame = beginFrame; makeAnimated(numberOfFrames, animationDelay);
this->currentFrame = beginFrame;
animate(); animate();
} }
void animate() { this->animating = true; } void setBeginFrame(int frame) { this->beginFrame = frame; }
void animateToFrame(int frame) { this->currentFrame = frame; } void animateToFrame(int frame) { this->currentFrame = frame; }
void animate() { this->animating = true; }
void stopAnimating() { this->animating = false; } void stopAnimating() { this->animating = false; }
void setStayWithinBounds(bool b) { stayWithinBounds = b; } void setStayWithinBounds(bool b) { stayWithinBounds = b; }
void setVelocity(int dx, int dy) { void setVelocity(int dx, int dy) {