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7,7,7,0,3,0,3,3,3,0,3,3,0,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,0,3,0,3,3,3,0,3,3,0,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,0,3,0,3,3,3,0,3,3,0,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,0,7,0,1,0,7,7,0,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,0,7,7,0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,7,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,0,7,7,7,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
},
};
the main file just uses a draw() method in the player class
void draw() {
game.display.load565Palette(bgdude_pal);
game.display.drawBitmap(x, y, bgdude[0]);
}
int main ()
{
loadMap();
cam = new Camera(mapRects, player);
game.begin();
game.display.palette[0] = game.display.RGBto565(0x0, 0x0, 0x0); // black (backgound)
game.display.palette[1] = game.display.RGBto565(0x00, 0xff, 0x00); // green
game.display.palette[2] = game.display.RGBto565(0xff, 0x00, 0x00); // red
game.display.palette[3] = game.display.RGBto565(0xff, 0xff, 0x00); // yellow
game.display.palette[4] = game.display.RGBto565(0x00, 0x00, 0xff); // blue
game.display.palette[5] = game.display.RGBto565(0x44, 0x44, 0x44);
while (game.isRunning()) {
if (game.update()) {
drawMap();
player->draw();
game.display.setColor(1);
cam->setPos(player->x + player->velocity.x, player->y + player->velocity.y);
cam->update();
if(game.rightBtn()) {
player->player_dir = player->right;
player->moveRight();
}
else if(game.leftBtn()) {
player->player_dir = player->left;
player->moveLeft();
}
if(game.upBtn()) {
player->player_dir = player->up;
player->moveUp();
}
else if(game.downBtn()) {
player->player_dir = player->down;
player->moveDown();
}
player->update();
player->collide(mapRects, num_rects);
}
}
return 1;
}