- Code: Select all
Arduino: 1.6.0 (Mac OS X), Board: "Arduino Uno"
Build options changed, rebuilding all
Using library SPI in folder: /Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/SPI
/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10600 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/cores/arduino -I/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/variants/standard -I/Applications/Arduino/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/libraries/SPI /var/folders/lz/t6b0h62d0l14shb28mmr1b9w0000gn/T/build3534859159284368520.tmp/Bugg.cpp -o /var/folders/lz/t6b0h62d0l14shb28mmr1b9w0000gn/T/build3534859159284368520.tmp/Bugg.cpp.o
Bugg.ino:4:23: fatal error: Gamebuino.h: No such file or directory
compilation terminated.
Error compiling.
I was trying to compile this program, which is coming along nicely thanks to all your help (until now ):
- Code: Select all
//imports the SPI library (needed to communicate with Gamebuino's screen)
#include <SPI.h>
//imports the Gamebuino library
#include <Gamebuino.h>
//creates a Gamebuino object named gb
Gamebuino gb;
static unsigned char PROGMEM logo[]=
{
40,12,
B00111100, B00110000, B11000011, B11000000, B11110000,
B00111100, B00110000, B11000011, B11000000, B11110000,
B11000011, B00110000, B11001100, B00110011, B00001100,
B11000011, B00110000, B11001100, B00110011, B00001100,
B11000011, B00110000, B11001100, B00000011, B00000000,
B11000011, B00110000, B11001100, B00000011, B00000000,
B11111100, B00110000, B11001100, B11000011, B00110000,
B11111100, B00110000, B11001100, B11000011, B00110000,
B11000011, B00110000, B11001100, B00110011, B00001100,
B11000011, B00110000, B11001100, B00110011, B00001100,
B00111100, B00001111, B00000011, B11000000, B11110000,
B00111100, B00001111, B00000011, B11000000, B11110000,
};
static unsigned char PROGMEM player[]=
{
8,8,
B00111100,
B01000010,
B10100101,
B10000001,
B10100101,
B10011001,
B01000010,
B00111100,
};
static unsigned char PROGMEM item2[]=
{
8,8,
B10100101,
B01111110,
B00111100,
B01100110,
B10111101,
B00100100,
B01111110,
B10011001,
};
static unsigned char PROGMEM item1[]=
{
8,8,
B11001010,
B11001011,
B11001011,
B11111111,
B10000001,
B10000001,
B10000001,
B11111111,
};
int score = 0; // score
int item1_quantity = 0;
int item2_quantity = 0;
int player_x = LCDWIDTH/2; //set the horizontal position to the middle of the screen
int player_y = LCDHEIGHT/2; //vertical position
int player_vx = 1; //horizontal velocity
int player_vy = 1; //vertical velocity
int player_size = 8; //the size of the player in number of pixels
int item1_size = 6; //SE
int item1_x = 30; //initial X position of item1
int item1_y = 10; //initial Y position of item1
int item2_size = 8; //SE
int item2_x = 40; //initial X position of item2
int item2_y = 2; //initial Y position of item2
int item2timer = 0;
boolean redon = false;
boolean greenon = false;
int red = 0;
int green = 0;
int redout = A5;
int greenout = A4;
boolean intro = false;
int time = 200;
// the setup routine runs once when Gamebuino starts up
void setup(){
pinMode(redout, OUTPUT);
pinMode(greenout, OUTPUT);
// initialize the Gamebuino object
gb.begin();
//display the main menu:
gb.titleScreen(F("Work In Progress"), logo);
}
// the loop routine runs over and over again forever
void loop(){
while(1){
if(gb.update()){
if(intro == false){
gb.popup(F("A-fast B-slow"), 40);
intro = true;
}
if(time <= 0){
while(true){
if(gb.update()){
gb.display.println("Game over!!");
gb.display.print("$"); gb.display.println(score);
gb.display.print("Cherries: "); gb.display.println(item1_quantity);
gb.display.print("Bombs: "); gb.display.println(item2_quantity);
if(gb.buttons.pressed(BTN_C)){
gb.titleScreen(F("Work In Progress"), logo);
int score = 0; // score
int item1_quantity = 0;
int item2_quantity = 0;
int item2timer = 0;
boolean redon = false;
boolean greenon = false;
int red = 0;
int green = 0;
int redout = A5;
int greenout = A4;
boolean intro = false;
int time = 200;
break;
}
}
}
}
time -= 1;
if(redon == true){
digitalWrite(redout, HIGH);
red += 1;
}
if(red >= 10){
red = 0;
redon = false;
digitalWrite(redout, LOW);
}
if(greenon == true){
digitalWrite(greenout, HIGH);
green += 1;
}
if(green >= 10){
green = 0;
greenon = false;
digitalWrite(greenout, LOW);
}
//item1 system
if(gb.collideBitmapBitmap( player_x, player_y, player, item1_x, item1_y, item1)){
item1_x = random(0, LCDWIDTH - item1_size);
item1_y = random(0, LCDHEIGHT - item1_size);
score += 1;
item1_quantity += 1;
greenon = true;
gb.sound.playOK();
}
//item2 system
if(item2timer >= 40){
item2timer = 0;
item2_x = random(0, LCDWIDTH - item2_size);
item2_y = LCDHEIGHT - item2_size;
gb.sound.playTick();
}
item2timer += 1;
item2_y -= 1;
if(gb.collideBitmapBitmap( player_x, player_y, player, item2_x, item2_y, item2)){
item2_y = LCDHEIGHT - item2_size;
item2_x = random(0, LCDWIDTH - item2_size);
item2timer = 0;
score -= 2;
item2_quantity += 1;
redon = true;
gb.sound.playCancel();
}
//move the player using the buttons
if(gb.buttons.repeat(BTN_RIGHT,2)){ //every 2 frames when the right button is held down
player_x = player_x + player_vx; //increase the horizontal position by the player's velocity
}
if(gb.buttons.repeat(BTN_LEFT,2)){
player_x = player_x - player_vx;
}
if(gb.buttons.repeat(BTN_DOWN,2)){
player_y = player_y + player_vy;
}
if(gb.buttons.repeat(BTN_UP,2)){
player_y = player_y - player_vy;
}
//speed selection
if(gb.buttons.pressed(BTN_A)){
gb.popup(F("SLOW"), 500);
gb.sound.playTick();
player_vx = 5;
player_vy = 5;
}
if(gb.buttons.pressed(BTN_B)){
gb.popup(F("SLOW"), 500);
gb.sound.playTick();
player_vx = 2;
player_vy = 2;
}
if( player_x < 0){
//bring it back in the screen
player_x = 0;
}
//if the player is touching the right side
if(( player_x + player_size) > LCDWIDTH){
player_x = LCDWIDTH - player_size;
}
//if the player is touching the top side
if( player_y < 0){
player_y = 0;
}
//if the player is touching the down side
if(( player_y + player_size) > LCDHEIGHT){
player_y = LCDHEIGHT - player_size;
}
//draw the player on the screen
gb.display.print("$ ");
gb.display.println(score);
gb.display.drawBitmap(player_x, player_y, player);
gb.display.drawBitmap(item1_x,item1_y,item1);
gb.display.drawBitmap(item2_x,item2_y,item2);
if(gb.buttons.pressed(BTN_C)){
gb.titleScreen(F("Game Paused"), logo);
}
}
}
}
What could be wrong?