annotate projects/tank_wars/game.h @ 39:638bc1ae2500 staging

Improved readibility of the DIGITAL code in the PRU, using register names instead of aliases and expanding some of the macros, removing unused macros. Binaries were not modified
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 13 May 2015 12:18:10 +0100
parents fbfeb5895efd
children 8d80eda512cd
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@22 30 float gameStatusProjectileHeight();
andrewm@10 31
andrewm@10 32 // Render screen; returns length of buffer used
andrewm@10 33 int drawGame(float *buffer, int bufferSize);
andrewm@10 34
andrewm@10 35 // Cleanup and memory release
andrewm@10 36 void cleanupGame();
andrewm@10 37
andrewm@10 38 #endif /* GAME_H_ */