Mercurial > hg > beaglert
annotate projects/tank_wars/game.h @ 14:06f93bef7dd2
Updated remaining examples to new API
author | andrewm |
---|---|
date | Fri, 23 Jan 2015 15:35:10 +0000 |
parents | 49f22e1246b2 |
children | fbfeb5895efd |
rev | line source |
---|---|
andrewm@10 | 1 /* |
andrewm@10 | 2 * game.h |
andrewm@10 | 3 * |
andrewm@10 | 4 * Created on: Nov 10, 2014 |
andrewm@10 | 5 * Author: parallels |
andrewm@10 | 6 */ |
andrewm@10 | 7 |
andrewm@10 | 8 #ifndef GAME_H_ |
andrewm@10 | 9 #define GAME_H_ |
andrewm@10 | 10 |
andrewm@10 | 11 // Initialisation |
andrewm@10 | 12 void setupGame(int width, int height); |
andrewm@10 | 13 void restartGame(); |
andrewm@10 | 14 |
andrewm@10 | 15 // Update physics |
andrewm@10 | 16 void nextGameFrame(); |
andrewm@10 | 17 |
andrewm@10 | 18 // State updaters |
andrewm@10 | 19 void setTank1CannonAngle(float angle); |
andrewm@10 | 20 void setTank2CannonAngle(float angle); |
andrewm@10 | 21 void setTank1CannonStrength(float strength); |
andrewm@10 | 22 void setTank2CannonStrength(float strength); |
andrewm@10 | 23 void fireProjectile(); |
andrewm@10 | 24 |
andrewm@10 | 25 // State queries |
andrewm@10 | 26 bool gameStatusPlayer1Turn(); |
andrewm@10 | 27 bool gameStatusProjectileInMotion(); |
andrewm@10 | 28 int gameStatusWinner(); |
andrewm@10 | 29 |
andrewm@10 | 30 // Render screen; returns length of buffer used |
andrewm@10 | 31 int drawGame(float *buffer, int bufferSize); |
andrewm@10 | 32 |
andrewm@10 | 33 // Cleanup and memory release |
andrewm@10 | 34 void cleanupGame(); |
andrewm@10 | 35 |
andrewm@10 | 36 #endif /* GAME_H_ */ |