4 * Created on: Aug 10, 2012
10 #include "../BattleState.h"
11 #include "../../app/Application.h"
12 #include "../../app/Input.h"
13 #include "../../geometry/operators.h"
14 #include "../../geometry/Point.h"
16 using app::Application;
18 using geometry::Point;
19 using geometry::Vector;
23 void RunState::EnterState(Application &c, SDL_Surface *screen) {
25 // TODO: push battle animation if enemy is faster
28 void RunState::ExitState(Application &c, SDL_Surface *screen) {
32 void RunState::ResumeState(Application &ctrl, SDL_Surface *screen) {
33 timer = GraphicsTimers().StartCountdown(2500);
36 void RunState::PauseState(Application &ctrl, SDL_Surface *screen) {
41 void RunState::Resize(int width, int height) {
46 void RunState::HandleEvents(const Input &input) {
47 if (timer.Finished()) {
48 ctrl->PopState(); // pop self
49 ctrl->PopState(); // pop battle
54 void RunState::UpdateWorld(float deltaT) {
58 void RunState::Render(SDL_Surface *screen) {
59 Vector<int> offset(battle->CalculateScreenOffset(screen));
60 battle->RenderBackground(screen, offset);
61 battle->RenderMonsters(screen, offset);
62 battle->RenderHeroes(screen, offset);