-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSprite.h
More file actions
50 lines (47 loc) · 1.1 KB
/
Sprite.h
File metadata and controls
50 lines (47 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
JFL
Sprite class extends entity, yet stores motion/animation information
*/
#include "Entity.h"
#ifndef __SPRITE__
#define __SPRITE__
class Sprite: public Entity{
public:
Sprite();
void setNumFrames(int n){numFrames = n;}
void setFrame(int f){currentFrame = f;}
void setState(int s){state = s;}
void setXVel(int x){xVel = x;}
void setYVel(int y){yVel = y;}
void setXAcc(int x){xAcc = x;}
void setYAcc(int y){yAcc = y;}
void setFlipped(int f){flipped = f;}
void setGrounded(int g){grounded = g;}
void update();
int getState(){return state;}
int getCurrentFrame(){return currentFrame;}
int getNumFrames(){return numFrames;}
int getXVel(){return xVel;}
int getYVel(){return yVel;}
int getXAcc(){return xAcc;}
int getYAcc(){return yAcc;}
int isFlipped(){return flipped;}
int isGrounded(){return grounded;}
protected:
int distBetweenFrames;
int currentFrame;
int numFrames;
int frameStartX;
int frameStartY;
int frameOffset;
int frameHeight;
int frameWidth;
int xVel;
int yVel;
int xAcc;
int yAcc;
int state;
int grounded;
int flipped;
};
#endif