2014-05-26 06:34:49 +02:00
|
|
|
#ifndef INGAMESTATE_HPP
|
|
|
|
#define INGAMESTATE_HPP
|
|
|
|
|
|
|
|
#include "State.hpp"
|
|
|
|
|
2014-08-12 22:15:26 +02:00
|
|
|
class PlayerController;
|
2014-05-26 06:34:49 +02:00
|
|
|
|
|
|
|
class IngameState : public State
|
|
|
|
{
|
2015-04-03 02:26:20 +02:00
|
|
|
bool started;
|
|
|
|
bool test;
|
2014-08-12 22:15:26 +02:00
|
|
|
ViewCamera _look;
|
2015-04-01 06:05:21 +02:00
|
|
|
/** Player input */
|
2014-05-26 06:34:49 +02:00
|
|
|
glm::vec2 _lookAngles;
|
|
|
|
glm::vec3 _movement;
|
2015-04-01 06:05:21 +02:00
|
|
|
/** Timer to reset _lookAngles to forward in vehicles */
|
2014-12-15 00:21:30 +01:00
|
|
|
float autolookTimer;
|
2014-05-26 06:34:49 +02:00
|
|
|
public:
|
2014-09-16 20:22:43 +02:00
|
|
|
IngameState(RWGame* game, bool test = false);
|
2014-05-26 06:34:49 +02:00
|
|
|
|
2014-07-24 00:57:21 +02:00
|
|
|
void startTest();
|
2015-04-03 02:26:20 +02:00
|
|
|
void startGame();
|
2014-05-26 06:34:49 +02:00
|
|
|
|
2014-08-12 22:15:26 +02:00
|
|
|
/** shortcut for getWorld()->state.player->getCharacter() */
|
|
|
|
PlayerController* getPlayer();
|
|
|
|
|
2014-05-26 06:34:49 +02:00
|
|
|
virtual void enter();
|
|
|
|
virtual void exit();
|
|
|
|
|
|
|
|
virtual void tick(float dt);
|
2015-02-07 23:55:06 +01:00
|
|
|
virtual void draw(GameRenderer* r);
|
2014-05-26 06:34:49 +02:00
|
|
|
|
|
|
|
virtual void handleEvent(const sf::Event& event);
|
2015-04-03 16:38:24 +02:00
|
|
|
|
|
|
|
virtual bool shouldWorldUpdate();
|
2014-08-12 22:15:26 +02:00
|
|
|
|
|
|
|
const ViewCamera& getCamera();
|
2014-05-26 06:34:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INGAMESTATE_HPP
|