//// The name of this file is "midterm-YOURNAME.pde"
//// GLOBAL DATA ////////
int score=0; // Score for the game.
float xHero,yHero; // Position of our "HERO".
float xBall,yBall, dxBall, dyBall; // Position of the ball.
float xBullets,yBullets, dxBullets, dyBullets; // Position of the first bullet.
float xBomb,yBomb, dxBomb,dyBomb; // Position of the bomb.
void draw() {
//// Move everything; then draw everything.
//// MOVE: ball, Bullets, bomb, hero.
moveBall();
moveBullets();
moveBomb();
moveHero(); // Also show effects of hits, etc. (and update score).
//// DRAW: scene + ball, Bullets, bomb, hero. Also show score.
drawScene();
drawBall( xBall, yBall );
drawBullets( xBullets, yBullets );
drawBomb( xBomb, yBomb );
drawHero( mouseX, mouseY ); // Hero follows the mouse!
}
|