Chris Dick
/
Gameduino_Invaders_game
Invaders game for the Gameduino
Diff: main.cpp
- Revision:
- 1:f44175dd69fd
- Parent:
- 0:8a7c58553b44
- Child:
- 2:20a89dc286d5
diff -r 8a7c58553b44 -r f44175dd69fd main.cpp --- a/main.cpp Thu Jun 21 19:13:34 2012 +0000 +++ b/main.cpp Sat Sep 29 13:01:42 2012 +0000 @@ -1,53 +1,53 @@ -#include "mbed.h" -#include "GD.h" - - -/*--------------------------------------------------------- - A Space Invaders clone for Gameduino - - http://www.artlum.com/gameduino/gameduino.html#invaders - - Version 0.9 alpha - Still seme things to add - but I'm out of memory! - - Edit "joystick.cpp" if you have a custom joystick. ----------------------------------------------------------*/ - -#include <SPI.h> -#include <GD.h> -#include "game.h" -#include "arduino.h" - -void setup() { - GD.begin(); - makeGraphics(); - Coprocessor::reset(samplePlaybackBuffer); - //randomSeed(GD.rd(FRAME)); - resetGameSounds(); - initGame(); -} - -void loop() { - GD.waitvblank(); - updateGame(); - updateGameSounds(); - - // Debugging/info - if (0) { - joystick.dump(0,33); // Show the joystick state - int yline = Coprocessor::yline(); - showNumber(yline,0,31); - } - // Screenshot when you press the select button - if (0 and joystick.isPressed(Joystick::buttonSelect)) { - sendScreenshot(); - } -} - - -int main() { - setup(); - while (1) { - loop(); - } +#include "mbed.h" +#include "GD.h" + + +/*--------------------------------------------------------- + A Space Invaders clone for Gameduino + + http://www.artlum.com/gameduino/gameduino.html#invaders + + Version 0.9 alpha - Still seme things to add + but I'm out of memory! + + Edit "joystick.cpp" if you have a custom joystick. +---------------------------------------------------------*/ + +#include <SPI.h> +#include <GD.h> +#include "game.h" +#include "arduino.h" + +void setup() { + GD.begin(); + makeGraphics(); + Coprocessor::reset(samplePlaybackBuffer); + randomSeed(GD.rd(FRAME)); + resetGameSounds(); + initGame(); +} + +void loop() { + GD.waitvblank(); + updateGame(); + updateGameSounds(); + + // Debugging/info + if (0) { + joystick.dump(0,33); // Show the joystick state + int yline = Coprocessor::yline(); + showNumber(yline,0,31); + } + // Screenshot when you press the select button + if (0 and joystick.isPressed(Joystick::buttonSelect)) { + sendScreenshot(); + } +} + + +int main() { + setup(); + while (1) { + loop(); + } } \ No newline at end of file