Question about drawBitmap
Posted: Mon Jan 19, 2015 1:55 pm
hey guys im new to the gamebuino but i want to programm a game like PokéMon
but for now i got a question why i get an error in my script while compiling
i got a error for the imagines where i try to make them look in the direktion im walking
and im gonna make some new trainer models with bitmap later dont worrie
sorry for that bad english im a german one
but for now i got a question why i get an error in my script while compiling
- Code: Select all
#include <Backlight.h>
#include <Battery.h>
#include <Buttons.h>
#include <Display.h>
#include <Gamebuino.h>
#include <Sound.h>
#include <SPI.h>
Gamebuino gb;
int trainer_x = LCDWIDTH/2;
int trainer_y = LCDHEIGHT/2;
int trainer_vx = 2;
int trainer_vy = 2;
int trainer_inv = 6;
const byte PROGMEM trainerup[] =
{
16,16,
B111111111111111,
B111111111111111,
B111111111111111,
B111111111111111,
B111111111111111,
B111111111111111,
B000000000000000,
B000000000000000,
B000000000000000,
B000000000000000,
B000000000000000,
B000000000000000,
B000000000000000,
B000000000000000,
B000000000000000,
B000000000000000,
};
const byte PROGMEM trainerdown[] =
{
16,16,
B0000000000000000,
B0000000000000000,
B0000000000000000,
B0000000000000000,
B0000000000000000,
B0000000000000000,
B0000000000000000,
B0000000000000000,
B0000000000000000,
B0000000000000000,
B1111111111111111,
B1111111111111111,
B1111111111111111,
B1111111111111111,
B1111111111111111,
B1111111111111111,
};
void setup(){
// put your setup code here, to run once:
gb.begin();
gb.titleScreen(F("PokeMon"));
}
void loop(){
// put your main code here, to run repeatedly:
if(gb.update()){
//HIER STEURERRUNG
if(gb.buttons.repeat(BTN_LEFT,1)){
trainer_x = trainer_x - trainer_vx;
}
if(gb.buttons.repeat(BTN_RIGHT,1)){
trainer_x = trainer_x + trainer_vx;
}
if(gb.buttons.repeat(BTN_UP,1)){
trainer_y = trainer_y - trainer_vy;
gb.display.drawBitmap(trainer_x,trainer_y,trainerup);
}
if(gb.buttons.repeat(BTN_DOWN,1)){
trainer_y = trainer_y + trainer_vy;
gb.display.drawBitmap(trainer_x,trainer_y,trainerdown);
}
if(trainer_x < 0){
trainer_x = 0;
}
if((trainer_x + 7) > LCDWIDTH){
trainer_x = LCDWIDTH - 7;
}
if(trainer_y < 0){
trainer_y = 0;
}
if((trainer_y + 8) > LCDHEIGHT){
trainer_y = LCDHEIGHT - 8;
}
//HIER POKE INVENTAR
}
}
i got a error for the imagines where i try to make them look in the direktion im walking
and im gonna make some new trainer models with bitmap later dont worrie
sorry for that bad english im a german one