Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Files Functions Variables Typedefs Macros Groups
game.h
1 /*
2  * game.h
3  *
4  * Created on: Nov 10, 2014
5  * Author: parallels
6  */
7 
8 #ifndef GAME_H_
9 #define GAME_H_
10 
11 // Initialisation
12 void setupGame(int width, int height);
13 void restartGame();
14 
15 // Update physics
16 void nextGameFrame();
17 
18 // State updaters
19 void setTank1CannonAngle(float angle);
20 void setTank2CannonAngle(float angle);
21 void setTank1CannonStrength(float strength);
22 void setTank2CannonStrength(float strength);
23 void fireProjectile();
24 
25 // State queries
26 bool gameStatusPlayer1Turn();
27 bool gameStatusProjectileInMotion();
28 int gameStatusWinner();
29 bool gameStatusCollisionOccurred();
30 bool gameStatusTankHitOccurred();
31 float gameStatusProjectileHeight();
32 
33 // Render screen; returns length of buffer used
34 int drawGame(float *buffer, int bufferSize);
35 
36 // Cleanup and memory release
37 void cleanupGame();
38 
39 #endif /* GAME_H_ */