Gamebuino Library Issues

Advice on general approaches or feasibility and discussions about game design

Gamebuino Library Issues

Postby TheSpikeFactory » Thu Feb 12, 2015 12:14 am

I installed the Gamebuino library, I use Mac OS X, and for some reason I cannot find where to put the 'hardware' and the 'libraries' folder. Does anyone know where to put them? :?:
TheSpikeFactory
 
Posts: 23
Joined: Wed Feb 11, 2015 11:42 pm

Re: Gamebuino Library Issues

Postby catsfolly » Thu Feb 12, 2015 11:17 pm

I put them at:

/Users/myusername/Documents/Arduino/hardware

and

/Users/myusername/Documents/Arduino/libraries
catsfolly
 
Posts: 5
Joined: Sun Feb 08, 2015 3:31 pm

Re: Gamebuino Library Issues

Postby TheSpikeFactory » Fri Feb 13, 2015 2:05 pm

I do not have a 'hardware' folder in the Arduino folder. Only 'libraries' and 'sketch_feb11m' folders exist.
TheSpikeFactory
 
Posts: 23
Joined: Wed Feb 11, 2015 11:42 pm

Re: Gamebuino Library Issues

Postby catsfolly » Fri Feb 13, 2015 3:18 pm

TheSpikeFactory wrote:I do not have a 'hardware' folder in the Arduino folder. Only 'libraries' and 'sketch_feb11m' folders exist.


I copied the "hardware" folder from the Gambuino-master folder to the Arduino folder. It only contains the Gamebuino folder, I don't know where the other hardwares are defined.

I added the contents of the Gamebuino-master/libraries folder to the Arduino/libraries folder. There was just a readme file in there.

Catsfolly
catsfolly
 
Posts: 5
Joined: Sun Feb 08, 2015 3:31 pm

Re: Gamebuino Library Issues

Postby TheSpikeFactory » Fri Feb 13, 2015 10:24 pm

Even doing what you told me to do, it says this:
"sketch_feb11m.ino5:29: fatal error: Gamebuino.h: No such file or directory
compilation terminated.
Error compiling."
TheSpikeFactory
 
Posts: 23
Joined: Wed Feb 11, 2015 11:42 pm

Re: Gamebuino Library Issues

Postby TheSpikeFactory » Sat Feb 14, 2015 1:27 am

Okay, I got it working, but now it's saying "error: expected declaration before '}' token.
What am I supposed to do now?
TheSpikeFactory
 
Posts: 23
Joined: Wed Feb 11, 2015 11:42 pm

Re: Gamebuino Library Issues

Postby Montiey » Sat Feb 14, 2015 1:36 am

That sounds like a code problem. Are you using an example or something home-brewed? Post an example of the code so we can see.
User avatar
Montiey
 
Posts: 68
Joined: Sat Jan 17, 2015 5:38 pm

Re: Gamebuino Library Issues

Postby TheSpikeFactory » Sat Feb 14, 2015 1:41 am

void setup() {
// put your setup code here, to run once:

}

void loop() {
// put your main code here, to run repeatedly:
}

}
//imports the SPI library
#include <SPI.h>
//imports the Gamebuino library
#include <Gamebuino.h>
//creates a Gamebuino object named gb
Gamebuino gb;

const byte PROGMEM sprite[] =
{
11,6,
B00011110000,
B01010100100,
B01000000100,
B00111111000,
B00010000000,
B00000100000,
};

void setup(){
gb.begin());
//display the main menu
gb.titleScreen(F("Dart Monkey Sprite"));
}
gb.sound.playTick();
//the main loop
void loop(){
if(gb.update()){
gb.display.drawBitmap(10,10,sprite);
}
}
This is the program.
TheSpikeFactory
 
Posts: 23
Joined: Wed Feb 11, 2015 11:42 pm

Re: Gamebuino Library Issues

Postby Montiey » Sat Feb 14, 2015 2:54 am

You have an extra parentheses right after void loop.
Also, you seem to have a totally extra void loop and void setup
This is what it should look like, but unfortunately there is still a problem with this code.
Code: Select all
//imports the SPI library
#include <SPI.h>
//imports the Gamebuino library
#include <Gamebuino.h>
//creates a Gamebuino object named gb
Gamebuino gb;

static unsigned char PROGMEM sprite[] =
{
  11,6,
  B00011110000,
  B01010100100,
  B01000000100,
  B00111111000,
  B00010000000,
  B00000100000,
};

void setup(){
  gb.begin());
  //display the main menu
  gb.titleScreen(F("Dart Monkey Sprite"));
}
gb.sound.playTick();
//the main loop
void loop(){
  if(gb.update()){
  gb.display.drawBitmap(11,6,sprite);
}
//This is the program.
User avatar
Montiey
 
Posts: 68
Joined: Sat Jan 17, 2015 5:38 pm

Re: Gamebuino Library Issues

Postby Skyrunner65 » Sat Feb 14, 2015 3:03 am

This is on the spot, but I think it works:
Code: Select all
#include <SPI.h> //imports the SPI library
#include <Gamebuino.h> //imports the Gamebuino library
Gamebuino gb; //creates a Gamebuino object named gb

static unsigned char PROGMEM sprite[] =
{
  12,6,
  B000111100000,
  B010101001000,
  B010000001000,
  B001111110000,
  B000100000000,
  B000001000000,
};

void setup(){
  gb.begin());
  //display the main menu
  gb.titleScreen(F("Dart Monkey Sprite"));
}
gb.sound.playTick();
//the main loop
void loop(){
  while(true) {
    if(gb.update()){
    gb.display.drawBitmap(12,6,sprite);
    }
  }
}
//This is the program.
User avatar
Skyrunner65
 
Posts: 371
Joined: Thu Mar 20, 2014 5:37 pm
Location: NC,USA

Next

Return to Project Guidance & Game development

Who is online

Users browsing this forum: No registered users and 4 guests

cron