Some problems [SOLVED]

So hi again everybody!

I started to code my very own game today and when I made a sprite I was so happy but when I complied it I got an error message:
exit status 1
‘B000000000000000’ was not declared in this scope
WTF is this? And when I searched the Internet for some soulution it didn’t find anything! So please can you help me and tell me what’s the problem?
(the sprite’s code is here:

const byte Huntersprite[] PROGMEM =
{
15,15,
B000000000000011,
B000000000000110,
B001110100001100,
B010011000110000,
B001101011000000,
B011001100000000,
B001001000100000,
B000110001100000,
B001011011000000,
B001111111000000,
B010000100000000,
B010000100000000,
B010000100000000,
B100000010000000,
B100000010000000,

}; )

Thanks a lot
Beni0121

1 Like

hey @Beni0121, congratulations on coding something for your MAKERbuino! :slight_smile:

Where did you get that binary bitmap output from?
Make sure to use Aurelien’s official Gamebuino bitmap encoder in order to get a Gamebuino library compatible binary image output:

Keep us updated on your progress!

Oh thanks Albert. Now My code is running perfectly because I just simply missed that 1 byte equals 8 0s or 1s. But thanks for the answer. And also I’m making some Duck Hunt like game for the MAKERbuino. It’s very challenging… :sweat_smile:

1 Like

@Beni0121, I’m glad that you’ve figured this out.

Neat, sounds interesting, keep us posted on your progress! :slight_smile:

Hello again

I’m back with some good news. Now I can move the hunter and the bird(it looks so realistic :smiley: ) flies through the screen but it doesn’t turn back and it doesn’t have a flying animation right now. So I think I’m going to continue the programming(shooting, menu, animations, maybe highscores?) on next Friday or the next saturday because I’m a student so I have a lot of stuff to learn(:sob:). And here’s the code:
#include <SPI.h>
#include <Gamebuino.h>
Gamebuino gb;

//Változó deklaráció

int playerPos = 0;
int birdPosX = 70;
int birdPosY = 10;
int birddead = 0;

const byte Huntersprite[][32] PROGMEM =
{
15,15,
B00000000,B00000100,
B00000000,B00001000,
B00111010,B00010000,
B01000100,B01100000,
B00110101,B10000000,
B01100110,B00000000,
B00100100,B01000000,
B00011000,B11000000,
B00101101,B10000000,
B00111111,B00000000,
B01000010,B00000000,
B01000010,B00000000,
B01000010,B00000000,
B10000001,B00000000,
B10000001,B00000000,

};

const byte Huntersprite2[][20] PROGMEM =
{
8,18,
B00010000,
B00010000,
B00010000,
B00010000,
B00011000,
B00100100,
B01011010,
B01100110,
B01011110,
B00100100,
B00111100,
B01000010,
B01000010,
B10000001,
B10000001,
B10000001,

};

const byte Huntersprite3[][32] PROGMEM =
{
15,15,
B00100000,B00000000,
B00010000,B00000000,
B00001000,B01011100,
B00000110,B00110010,
B00000001,B10101100,
B00000000,B01100110,
B00000000,B00100100,
B00000010,B00011000,
B00000011,B00110100,
B00000001,B11111100,
B00000000,B01000010,
B00000000,B01000010,
B00000000,B01000010,
B00000000,B10000001,
B00000000,B10000001,

};

const byte bullet[][4] PROGMEM =
{
8,2,
B10000000,
B10000000,
};

const byte Pigeonsprite1[][12] PROGMEM =
{
14,5,
B11111000,B00000000,
B00000100,B00000000,
B00000101,B11111000,
B00000010,B00000100,
B00000100,B00000100,
};

const byte Pigeonsprite2[][12] PROGMEM =
{
14,5,
B00000000,B00000000,
B01111100,B01111000,
B10000010,B10000100,
B10000001,B00000100,
B00000000,B00000100,
};

const byte Pigeonsprite3[][12] PROGMEM =
{
14,5,
B00000000,B01111100,
B00000000,B10000000,
B01111110,B10000000,
B10000001,B00000000,
B10000000,B10000000,
};
// the setup routine runs once when Gamebuino starts up
void setup(){
// initialize the Gamebuino object
gb.begin();
//display the main menu:
gb.titleScreen(F(“Pigeon Season”));

};

// the main loop
void loop(){
if(gb.update()){
//gb.display.drawBitmap(10,10,sprite[0]);
if (gb.buttons.pressed(BTN_LEFT)) {
if (playerPos > -2) {
playerPos–;
}
}
if (gb.buttons.pressed(BTN_RIGHT)) {
if (playerPos < 2) {
playerPos++;
}
}

if (playerPos == 0) {
gb.display.drawBitmap(38,30,Huntersprite2[0]);
}
if (playerPos == -1) {
gb.display.drawBitmap(19,30,Huntersprite[0]);
}
if (playerPos == 1) {
gb.display.drawBitmap(64,30,Huntersprite3[0]);
}

if (birddead == 0) {
gb.display.drawBitmap(birdPosX–,birdPosY,Pigeonsprite1[0]);
/*if (birdPosX <= 14) {
gb.display.drawBitmap(birdPosX++,birdPosY,Pigeonsprite1[0]);
}
if (birdPosX >= 70) {
gb.display.drawBitmap(birdPosX–,birdPosY,Pigeonsprite1[0]);
};

*/}
}
};

1 Like

Congratulations @Beni0121, your code looks neat.

You might want to share it via GitHub so that you can have a better control of your version and development history and do not have to paste it directly in forum comments.

Also, it would be cool if you could make a gif of your code in action so that everybody can see your game without compiling it beforehand.

Keep learning and good luck!