Flock You!
 All Classes Files Functions Variables
game.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SDL.h>
4 #include <vector>
5 #include <time.h>
6 #include "state.h"
7 #include "stateManager.h"
8 #include "texture.h"
9 #include "text.h"
10 #include "audio.h"
11 #include "boid.h"
12 #include "help.h"
13 
19 class Game : public State
20 {
21 private:
22  /*a texture of a white square*/
24  /*a vector of Boid objects*/
25  std::vector<Boid*> boids;
26  /*What to do with the rule (1 == possitve, 0 = neutral, -1 == negative)*/
28  /*rendered text*/
29  std::vector<Text *> text;
30 
36  Vec2 rule1(int);
37 
43  Vec2 rule2(int);
44 
50  Vec2 rule3(int);
51 
57  Vec2 roughBoundaries(int);
58 
63  void limitVelocity(int);
64 
65 public:
73  Game(StateManager *, SDL_Renderer *, int, int);
74 
78  ~Game();
79 
84  bool input();
85 
91  void update(float deltaTime);
92 
96  void draw();
97 };
void limitVelocity(int)
Definition: game.cpp:324
~Game()
Definition: game.cpp:29
Creates a State object. Creates a State object to be inherited.
Definition: state.h:14
std::vector< Text * > text
Definition: game.h:29
Creates an Vec2 structure with functions Creates an Vec2 structure with overloaded operators to creat...
Definition: vec2.h:7
Texture * whiteSquare
Definition: game.h:23
Creates a StateManager object. Creates a StateManager object to be inherited.
Definition: stateManager.h:10
int applyRule3
Definition: game.h:27
int applyRule1
Definition: game.h:27
Creates a Texture for use with a renderer Creates a Texture from an image file, this can then be used...
Definition: texture.h:12
bool input()
Definition: game.cpp:45
Vec2 rule2(int)
Definition: game.cpp:225
Creates an Game object that inherits State Creates an Game object that inherits State and runs the Ga...
Definition: game.h:19
void draw()
Definition: game.cpp:168
Vec2 roughBoundaries(int)
Definition: game.cpp:286
Vec2 rule1(int)
Definition: game.cpp:194
Game(StateManager *, SDL_Renderer *, int, int)
Definition: game.cpp:6
std::vector< Boid * > boids
Definition: game.h:25
Vec2 rule3(int)
Definition: game.cpp:257
int applyRule2
Definition: game.h:27
void update(float deltaTime)
Definition: game.cpp:132