Bridges-C++
3.4.4
Bridges(C++ API)
|
#include <GameBase3D.h>
This class extends the GameBase class to 3D environments.
This class forms the infrastructure for the BRIDGES Game API and contains methods for input listener and drawing functions and attributes
Public Member Functions | |
void | addScene (Scene &sc) |
Scene | getCurrentScene () |
bool | gameover () const |
Public Attributes | |
Scene | current_scene |
Protected Member Functions | |
GameBase3D (int assignmentID, std::string username, std::string apikey) | |
Protected construction prevens direct creation. More... | |
virtual | ~GameBase3D ()=default |
virtual void | initialize ()=0 |
This function is called once when the game starts. More... | |
virtual void | gameLoop ()=0 |
This function is called once per frame of the game. More... | |
void | registerKeyListener (KeypressListener *p) |
register a new KeypressListener More... | |
void | render () |
Renders the game. More... | |
void | quit () |
calling this function causes the game to end. More... | |
void | setTitle (std::string title) |
Set the title of the game. More... | |
void | setDescription (std::string desc) |
Set a short description of the game. More... | |
Protected Attributes | |
bool | debug = false |
|
inlineprotected |
Protected construction prevens direct creation.
Having a protected constructor prevents the object from being directly created. Since GameBase is meant to be a purely internal class, that seems appropriate.
|
protectedvirtualdefault |
|
inline |
|
protectedpure virtual |
This function is called once per frame of the game.
Students write this function. It will be called at each frame of the game.
|
inline |
|
inline |
|
protectedpure virtual |
This function is called once when the game starts.
Students write this function. It will be called once at the begining of the game.
|
inlineprotected |
calling this function causes the game to end.
That is to say, the current frame will be the last frame of the game.
|
inlineprotected |
register a new KeypressListener
Students should not have to call this function directly. The KeypressListener listener will get notified of all keypresses (up and down) that happens in the game.
p | a KeypressListener to register |
|
inlineprotected |
Renders the game.
Student should not have to call this function directly. It is called automatically by Bridges.
|
inlineprotected |
Set a short description of the game.
desc | Description of the game |
|
inlineprotected |
Set the title of the game.
title | Title of the game |
Scene bridges::game::GameBase3D::current_scene |
|
protected |