Creates an Game object that inherits State Creates an Game object that inherits State and runs the Game. DISCLAMER: Created using Pseudo code from https://www.macs.hw.ac.uk/~dwcorne/Teaching/Boids%20Pseudocode.htm.
More...
#include <game.h>
Creates an Game object that inherits State Creates an Game object that inherits State and runs the Game. DISCLAMER: Created using Pseudo code from https://www.macs.hw.ac.uk/~dwcorne/Teaching/Boids%20Pseudocode.htm.
Game::Game |
( |
StateManager * |
inStateManager, |
|
|
SDL_Renderer * |
inRenderer, |
|
|
int |
inWidth, |
|
|
int |
inHeight |
|
) |
| |
Constructs an Game object
- Parameters
-
StateManager | * a pointer to the StateManager |
SDL_Renderer | * a pointer to the renderer |
int | the screen width |
int | the screen height |
A function to draw to the screen
Implements State.
void Game::limitVelocity |
( |
int |
boidIndex | ) |
|
|
private |
Limits the Boid velocity
- Parameters
-
int | the index of the Boid to test |
Vec2 Game::roughBoundaries |
( |
int |
boidIndex | ) |
|
|
private |
Applies Boid rough boundaries
- Parameters
-
int | the index of the Boid to test |
- Returns
- Vec2 the resultant velocity of the boundary
Vec2 Game::rule1 |
( |
int |
boidIndex | ) |
|
|
private |
Applies Boid Rule 1
- Parameters
-
int | the index of the Boid to test |
- Returns
- Vec2 the resultant velocity of the rule
Vec2 Game::rule2 |
( |
int |
boidIndex | ) |
|
|
private |
Applies Boid Rule 2
- Parameters
-
int | the index of the Boid to test |
- Returns
- Vec2 the resultant velocity of the rule
Vec2 Game::rule3 |
( |
int |
boidIndex | ) |
|
|
private |
Applies Boid Rule 3
- Parameters
-
int | the index of the Boid to test |
- Returns
- Vec2 the resultant velocity of the rule
void Game::update |
( |
float |
deltaTime | ) |
|
|
virtual |
A function to update the Game A function to update the Game to allow the Game to run
- Parameters
-
Implements State.
std::vector<Boid*> Game::boids |
|
private |
std::vector<Text *> Game::text |
|
private |
The documentation for this class was generated from the following files: