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();
}
void makeAnimated(int beginFrame, int numberOfFrames, int animationDelay) {
this->numberOfFrames = numberOfFrames;
this->animationDelay = animationDelay;
this->beginFrame = beginFrame;
this->currentFrame = beginFrame;
setBeginFrame(beginFrame);
animateToFrame(beginFrame);
makeAnimated(numberOfFrames, animationDelay);
animate();
}
void animate() { this->animating = true; }
void setBeginFrame(int frame) { this->beginFrame = frame; }
void animateToFrame(int frame) { this->currentFrame = frame; }
void animate() { this->animating = true; }
void stopAnimating() { this->animating = false; }
void setStayWithinBounds(bool b) { stayWithinBounds = b; }
void setVelocity(int dx, int dy) {