Bridges-C++  3.4.2
Bridges(C++ API)
Public Member Functions | Protected Member Functions | List of all members
bridges::game::NonBlockingGame3D Class Reference

#include <NonBlockingGame3D.h>

Inheritance diagram for bridges::game::NonBlockingGame3D:
bridges::game::GameBase3D

Detailed Description

This class is an extension of the NonBlockingGame class to 3D game environments.

The games that can be created out of NonBlockingGame3D are currently based on terrain models and simple interactions with them

Author
Kalpathi Subramanian, Matthew Mcquaigue
Date
9/22/22

Public Member Functions

 NonBlockingGame3D (int assignmentID, std::string username, std::string apikey)
 
virtual ~NonBlockingGame3D ()=default
 
void start ()
 Call this function from main to start the game. Runs exactly once. More...
 
- Public Member Functions inherited from bridges::game::GameBase3D
void addScene (Scene &sc)
 
Scene getCurrentScene ()
 
bool gameover () const
 

Protected Member Functions

double getFrameRate () const
 What frame rate is the game running at? More...
 
bool keyLeft ()
 Is Left currently pressed? More...
 
bool keyRight ()
 Is Right currently pressed? More...
 
bool keyUp ()
 Is Up currently pressed? More...
 
bool keyDown ()
 Is Down currently pressed? More...
 
bool keyW ()
 Is W currently pressed? More...
 
bool keyA ()
 Is A currently pressed? More...
 
bool keyS ()
 Is S currently pressed? More...
 
bool keyD ()
 Is D currently pressed? More...
 
bool keyQ ()
 Is Q currently pressed? More...
 
bool keySpace ()
 Is Space currently pressed? More...
 
- Protected Member Functions inherited from bridges::game::GameBase3D
 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...
 

Additional Inherited Members

- Public Attributes inherited from bridges::game::GameBase3D
Scene current_scene
 
- Protected Attributes inherited from bridges::game::GameBase3D
bool debug = false
 

Constructor & Destructor Documentation

◆ NonBlockingGame3D()

bridges::game::NonBlockingGame3D::NonBlockingGame3D ( int  assignmentID,
std::string  username,
std::string  apikey 
)
inline

constructor

Parameters
assignmentIDBridges assignment id
usernameBridges user name
apikeyBridges API authentication key
nbRowGameGrid height
nbColGameGrid width

◆ ~NonBlockingGame3D()

virtual bridges::game::NonBlockingGame3D::~NonBlockingGame3D ( )
virtualdefault

Member Function Documentation

◆ getFrameRate()

double bridges::game::NonBlockingGame3D::getFrameRate ( ) const
inlineprotected

What frame rate is the game running at?

Returns
the target framerate. The game could be somewhat slower depending on how computationally expensive the gameloop is and on the speed of the network.

◆ keyA()

bool bridges::game::NonBlockingGame3D::keyA ( )
inlineprotected

Is A currently pressed?

Returns
true if A is currently pressed

◆ keyD()

bool bridges::game::NonBlockingGame3D::keyD ( )
inlineprotected

Is D currently pressed?

Returns
true if D is currently pressed

◆ keyDown()

bool bridges::game::NonBlockingGame3D::keyDown ( )
inlineprotected

Is Down currently pressed?

Returns
true if Down is currently pressed

◆ keyLeft()

bool bridges::game::NonBlockingGame3D::keyLeft ( )
inlineprotected

Is Left currently pressed?

Returns
true if Left is currently pressed

◆ keyQ()

bool bridges::game::NonBlockingGame3D::keyQ ( )
inlineprotected

Is Q currently pressed?

Returns
true if S is currently pressed

◆ keyRight()

bool bridges::game::NonBlockingGame3D::keyRight ( )
inlineprotected

Is Right currently pressed?

Returns
true if Right is currently pressed

◆ keyS()

bool bridges::game::NonBlockingGame3D::keyS ( )
inlineprotected

Is S currently pressed?

Returns
true if S is currently pressed

◆ keySpace()

bool bridges::game::NonBlockingGame3D::keySpace ( )
inlineprotected

Is Space currently pressed?

Returns
true if Space is currently pressed

◆ keyUp()

bool bridges::game::NonBlockingGame3D::keyUp ( )
inlineprotected

Is Up currently pressed?

Returns
true if Up is currently pressed

◆ keyW()

bool bridges::game::NonBlockingGame3D::keyW ( )
inlineprotected

Is W currently pressed?

Returns
true if W is currently pressed

◆ start()

void bridges::game::NonBlockingGame3D::start ( )
inline

Call this function from main to start the game. Runs exactly once.


The documentation for this class was generated from the following file: