Edited map, new efence tile
[sdlbotor.git] / Player.h
blob23b52cfb7cbdbe5dbec249b588a10b2f403252a6
1 #ifndef PLAYER_H
2 #define PLAYER_H
4 #include "LivingMapObject.h"
5 #include "DAnimation.h"
6 #include "Tileset.h"
7 #include "Object.h"
8 #include "Inventory.h"
10 namespace botor
13 class Object;
14 class Inventory;
16 class Player : public LivingMapObject
19 private:
21 unsigned int lives;
23 anim_t *p_ani_idle;
24 anim_t *p_ani_walking;
26 anim_t ani_idle;
27 anim_t ani_walking;
29 anim_t ani_immuneIdle;
30 anim_t ani_immuneWalking;
32 DAnimation *ani_player;
34 Inventory inv;
36 static Tileset PLAYER_TILESET;
38 protected:
41 bool immune;
43 public:
45 static const float PLAYER_SPEED = 0.1f;
47 public:
49 Player( Uint8 X = 0, Uint8 Y = 0 );
50 // ~Player();
52 private:
54 void InitWalking( Uint8 X, Uint8 Y );
58 protected:
60 float SPEED();
62 bool isWalkable( Uint8 X, Uint8 Y );
64 public:
66 virtual void Draw( );
68 void HandleInput( SDL_Event *event );
70 void OnTile( Tile *t );
71 void OnDead();
73 void ResetPlayer();
75 void Pickup( Object *o );
76 void Drop( Object *o );
77 void Use( Object *o );
79 void SetImmune( bool newstate );
81 unsigned int getLives();
88 #endif