[go: up one dir, main page]

Menu

[r9]: / engine / DynamicSprite.h  Maximize  Restore  History

Download this file

34 lines (28 with data), 779 Bytes

 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
#ifndef _DYNAMICSPRITE_H_
#define _DYNAMICSPRITE_H_
#include "ISprite.h"
class Sound;
class DynamicSprite : public ISprite
{
private:
int xVel, yVel;
int directionIndex;
int movementIndex;
SDL_Surface *surface;
SDL_Rect movementClips[CHARDIRTOTAL][CHARMOVETOTAL];
Sound *actionSound;
Sound *deadSound;
public:
DynamicSprite();
virtual ~DynamicSprite();
void loadActionSound(char *actionFileName);
void loadDeadSound(char *deadFileName);
void setImageWH(int w, int h);
bool checkCollision(SDL_Rect *A, SDL_Rect *B );
virtual void loadAnimatedClips(string fileName);
virtual void init();
virtual void draw(SDL_Surface *screen, SDL_Rect *camera);
virtual int handleInput(SDL_Event *event);
virtual void update();
};
#endif