Created Player; not happy with movement

This commit is contained in:
Kayne Ruse
2013-04-29 08:27:03 +10:00
parent 392ef1ef32
commit 7dafb372b1
8 changed files with 274 additions and 37 deletions
+3 -3
View File
@@ -9,12 +9,12 @@ SpriteSheet::SpriteSheet(SDL_Surface* s, int w, int h)
}
void SpriteSheet::Update(int delta) {
if ((ticks += delta) > interval) {
if (interval && (ticks += delta) > interval) {
if (++currentFrame >= maxFrames) {
currentFrame = 0;
}
ticks = 0;
SetClipX(currentFrame * GetClipW());
SetClipY(currentStrip * GetClipH());
}
SetClipX(currentFrame * GetClipW());
SetClipY(currentStrip * GetClipH());
}