123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // Created by jovian on 18/07/17.
- //
- #ifndef TINYSHOOTER_SOLDIER_H
- #define TINYSHOOTER_SOLDIER_H
- #include "Entity.h"
- #include "Bullet.h"
- #include "TinyWorld.h"
- #include "../Control/Controller.h"
- class Soldier : public Entity {
- public:
- Soldier(Faction faction, Controller *ctrl, TinyWorld* tinyWorld,
- unsigned int imgId, unsigned int camp, unsigned int life = 100);
- void shoot(const b2Vec2 &dir);
- virtual void update();
- void createPhysicalShape(b2Vec2 spawn = b2Vec2_zero);
- protected:
- Controller *m_ctrl; // Decision interface
- unsigned int m_camp; // 0 : ally, 1 : foe
- unsigned int m_life; // alive if above 0
- TinyWorld* m_tinyWorld; // Allows shooting (And allows AI to take decisions)
- b2Fixture* m_homeFixture; // Allows bullet determination in contacts
- // Movements
- float m_forceScale;
- b2Vec2 m_jumpVec;
- float m_jumpVelocityLimit;
- // Weapon
- unsigned int m_cool;
- const unsigned int m_coolCeil;
- };
- #endif //TINYSHOOTER_SOLDIER_H
|