Mercurial > hg > beaglert
annotate examples/tank_wars/game.h @ 349:6e454ebd9cc4 prerelease
Removed libpd_queued
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Wed, 08 Jun 2016 01:55:25 +0100 |
parents | dbeed520b014 |
children |
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@22 | 29 bool gameStatusCollisionOccurred(); |
andrewm@268 | 30 bool gameStatusTankHitOccurred(); |
andrewm@22 | 31 float gameStatusProjectileHeight(); |
andrewm@10 | 32 |
andrewm@10 | 33 // Render screen; returns length of buffer used |
andrewm@10 | 34 int drawGame(float *buffer, int bufferSize); |
andrewm@10 | 35 |
andrewm@10 | 36 // Cleanup and memory release |
andrewm@10 | 37 void cleanupGame(); |
andrewm@10 | 38 |
andrewm@10 | 39 #endif /* GAME_H_ */ |