The enemy is moving!

This commit is contained in:
Arne van Iterson 2019-12-19 19:56:26 +01:00
parent ee0c04706a
commit 000a5cfe90
16 changed files with 2560 additions and 2212 deletions

File diff suppressed because it is too large Load Diff

View File

@ -7,72 +7,72 @@
_bullet_data: _bullet_data:
DB 16 DB 16
DB 16 DB 16
DB 8 DB 12
DB 8 DB 12
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 5 DB 7
DB 5 DB 7
DB 5 DB 7
DB 5 DB 7
DB 2 DB 1
DB 2 DB 1
DB 8 DB 12
DB 8 DB 12
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 5 DB 7
DB 5 DB 7
DB 5 DB 7
DB 5 DB 7
DB 2 DB 1
DB 2 DB 1
DB 8 DB 12
DB 8 DB 12
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
@ -83,12 +83,12 @@ _bullet_data:
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 5 DB 7
DB 5 DB 7
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
@ -99,12 +99,12 @@ _bullet_data:
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 5 DB 7
DB 5 DB 7
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
@ -117,10 +117,10 @@ _bullet_data:
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
@ -133,10 +133,10 @@ _bullet_data:
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
@ -149,10 +149,10 @@ _bullet_data:
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
@ -165,10 +165,10 @@ _bullet_data:
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
@ -179,12 +179,12 @@ _bullet_data:
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 5 DB 7
DB 5 DB 7
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
@ -195,74 +195,74 @@ _bullet_data:
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 5 DB 7
DB 5 DB 7
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 5 DB 7
DB 5 DB 7
DB 5 DB 7
DB 5 DB 7
DB 2 DB 1
DB 2 DB 1
DB 8 DB 12
DB 8 DB 12
DB 2 DB 1
DB 2 DB 1
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 0 DB 0
DB 5 DB 7
DB 5 DB 7
DB 5 DB 7
DB 5 DB 7
DB 2 DB 1
DB 2 DB 1
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 2 DB 1
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
DB 8 DB 12
XDEF _bullet_data XDEF _bullet_data
; 1 // convpng v7.2 ; 1 // convpng v7.2
; 2 #include <stdint.h> ; 2 #include <stdint.h>

File diff suppressed because it is too large Load Diff

View File

@ -6,18 +6,22 @@
SEGMENT DATA SEGMENT DATA
_sprites_pal: _sprites_pal:
DW 65535 DW 65535
DW 63421
DW 0 DW 0
DW 46509 DW 63421
DW 23254 DW 23254
DW 23254
DW 61307
DW 19026 DW 19026
DW 46509
DW 2114
DW 23254
DW 4228
DW 19026
DW 26425
DW 60250
DW 0 DW 0
XDEF _sprites_pal XDEF _sprites_pal
; 1 // convpng v7.2 ; 1 // convpng v7.2
; 2 #include <stdint.h> ; 2 #include <stdint.h>
; 3 #include "sprites.h" ; 3 #include "sprites.h"
; 4 ; 4
; 5 uint16_t sprites_pal[9] = { ; 5 uint16_t sprites_pal[13] = {
END END

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,46 @@
// baddie.h // baddie.h
int baddieSpawned;
struct Baddie { struct Baddie {
bool dead; bool dead;
struct pos { struct pos {
float x; float x;
float y; float y;
} pos; } pos;
} baddies[32]; } baddies[baddieAmount];
int spawnBaddie(float posX, float posY)
{
for (i = 0; i < baddieAmount; i++)
{
if (baddies[i].dead == true)
{
baddies[i].pos.x = posX;
baddies[i].pos.y = posY;
baddies[i].dead = false;
return 1;
}
}
return 0;
}
int updateBaddie(int i)
{
if (baddies[i].dead == false)
{
if (!(baddies[i].pos.x <= (0 - 32)))
{
baddies[i].pos.x -= speed;
gfx_Sprite(baddie, baddies[i].pos.x, baddies[i].pos.y);
return 1;
}
else
{
baddies[i].dead = true;
return 1;
}
}
else {
return 0;
}
}

View File

@ -1,41 +1,47 @@
// bullet.h // bullet.h
struct Bullet { int bulletSpawned;
struct Bullet
{
bool dead; bool dead;
struct pos { struct pos
{
float x; float x;
float y; float y;
} pos; } pos;
} bullets[5]; } bullets[bulletAmount];
// Reset all bullets int spawnBullet(float posX, float posY)
for (i = 0; i < sizeof(bullets); i++)
{ {
bullets[i].dead = true; for (i = 0; i < bulletAmount; i++)
bullets[i].pos.x = 0; {
bullets[i].pos.y = 0; if (bullets[i].dead == true)
} {
int spawnBullet(float posX, float posY) {
for (i = 0; i < sizeof(bullets); i++) {
if (bullets[i].dead == true) {
bullets[i].pos.x = posX; bullets[i].pos.x = posX;
bullets[i].pos.y = posY; bullets[i].pos.y = posY;
bullets[i].dead = false; bullets[i].dead = false;
return 1; return 1;
} }
} }
return 0;
} }
void updateBullets() { int updateBullet(int i)
for (i = 0; i < sizeof(bullets); i++) { {
if (bullets[i].dead == false) { if (bullets[i].dead == false)
{
if (!(bullets[i].pos.x >= (LCD_WIDTH + 16))) if (!(bullets[i].pos.x >= (LCD_WIDTH + 16)))
{ {
bullets[i].pos.x += speed; bullets[i].pos.x += speed;
gfx_Sprite(bullet, bullets[i].pos.x, bullets[i].pos.y); gfx_Sprite(bullet, bullets[i].pos.x, bullets[i].pos.y);
} else { return 1;
}
else
{
bullets[i].dead = true; bullets[i].dead = true;
return 1;
} }
} } else {
return 0;
} }
} }

View File

@ -1,3 +1,73 @@
// controls.h // controls.h
// Scan keyboard for button presses // Scan keyboard for button presses
kb_Scan(); #include <keypadc.h>
void handleInput()
{
// Scan keyboard for button presses
kb_Scan();
// Move player
if (kb_Data[7] & kb_Down)
{
if (!(player.pos.y >= (LCD_HEIGHT - 32)))
{
player.pos.y += speed;
}
}
if (kb_Data[7] & kb_Up)
{
if (!(player.pos.y <= 0))
{
player.pos.y -= speed;
}
}
if (kb_Data[7] & kb_Left)
{
if (!(player.pos.x <= 0))
{
player.pos.x -= speed;
}
}
if (kb_Data[7] & kb_Right)
{
if (!(player.pos.x >= (LCD_WIDTH - 32)))
{
player.pos.x += speed;
}
}
// Spawn bullet on 2nd press
if (kb_Data[1] & kb_2nd)
{
// If bullet has already been spawned (You cannot hold the button)
if (bulletSpawned == 0)
{
spawnBullet((player.pos.x + 16), (player.pos.y + 8));
bulletSpawned = 1;
}
}
// Set bulletSpawned to false if button is let loose
if (kb_Data[1] != kb_2nd)
{
bulletSpawned = 0;
}
// Spawn baddie on 2nd press
if (kb_Data[1] & kb_Mode)
{
// If baddie has already been spawned (You cannot hold the button)
if (baddieSpawned == 0)
{
spawnBaddie((LCD_WIDTH + 32), randInt(0, (LCD_HEIGHT - 32)));
baddieSpawned = 1;
}
}
// Set baddieSpawned to false if button is let loose
if (kb_Data[1] != kb_Mode)
{
baddieSpawned = 0;
}
}

View File

@ -5,36 +5,36 @@
// 8 bpp image // 8 bpp image
uint8_t baddie_data[1026] = { uint8_t baddie_data[1026] = {
32,32, // width,height 32,32, // width,height
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x01,0x01,
0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x01,0x01,0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x01,0x01,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x01,0x01,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x01,0x01,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x01,0x01,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x01,0x01,
0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,
0x02,0x02,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02, 0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,
0x08,0x08,0x02,0x02,0x03,0x03,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x09,0x09,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x03,0x03,0x02,0x02,0x06,0x06,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x09,0x09,0x02,0x02,0x08,0x08,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x0A,0x0A,0x03,0x03,0x04,0x04,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x06,0x06,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x0B,0x0A,0x03,0x03,0x04,0x04,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x09,0x09,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x09,0x09,0x02,0x02,0x02,0x02,0x03,0x03,0x03,0x03,0x04,0x04,0x04,0x04,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x03,0x03,0x04,0x04,0x04,0x04,0x01,0x01,0x04,0x04,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x09,0x09,0x02,0x02,0x03,0x03,0x04,0x04,0x04,0x04,0x01,0x01,0x04,0x04,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02, 0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,
}; };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 408 B

View File

@ -5,20 +5,20 @@
// 8 bpp image // 8 bpp image
uint8_t bullet_data[258] = { uint8_t bullet_data[258] = {
16,16, // width,height 16,16, // width,height
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x02,0x02,0x08,0x08, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,0x01,0x01,0x0C,0x0C,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x02,0x02,0x08,0x08, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,0x01,0x01,0x0C,0x0C,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x02,0x02, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x01,0x01,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x02,0x02, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x01,0x01,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x02,0x02, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x01,0x01,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x02,0x02, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x01,0x01,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x02,0x02,0x08,0x08, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,0x01,0x01,0x0C,0x0C,
0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,0x05,0x05,0x02,0x02,0x08,0x08, 0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x07,0x07,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,
}; };

View File

@ -5,36 +5,36 @@
// 8 bpp image // 8 bpp image
uint8_t spaceship_data[1026] = { uint8_t spaceship_data[1026] = {
32,32, // width,height 32,32, // width,height
0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x04,0x04,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x03,0x03,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x04,0x04,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x03,0x03,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x04,0x04,0x02,0x02,0x03,0x03,0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x03,0x03,0x01,0x01,0x05,0x05,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x04,0x04,0x02,0x02,0x03,0x03,0x02,0x02,0x01,0x01,0x02,0x02,0x08,0x08, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x03,0x03,0x01,0x01,0x05,0x05,0x01,0x01,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x02,0x02,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x08,0x08, 0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x0C,0x0C,
0x02,0x02,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x03,0x03,0x02,0x02,0x08,0x08, 0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x05,0x05,0x01,0x01,0x0C,0x0C,
0x02,0x02,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02, 0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,
0x02,0x02,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02, 0x01,0x01,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,
0x02,0x02,0x07,0x07,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, 0x01,0x01,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
0x02,0x02,0x07,0x07,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, 0x01,0x01,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
0x02,0x02,0x07,0x07,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, 0x01,0x01,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
0x02,0x02,0x07,0x07,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, 0x01,0x01,0x04,0x04,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
0x02,0x02,0x07,0x07,0x04,0x04,0x04,0x04,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, 0x01,0x01,0x04,0x04,0x03,0x03,0x03,0x03,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
0x02,0x02,0x07,0x07,0x04,0x04,0x04,0x04,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02, 0x01,0x01,0x04,0x04,0x03,0x03,0x03,0x03,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,
0x08,0x08,0x02,0x02,0x07,0x07,0x04,0x04,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x04,0x04,0x03,0x03,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x07,0x07,0x04,0x04,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x04,0x04,0x03,0x03,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x07,0x07,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x04,0x04,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x07,0x07,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x04,0x04,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,
0x08,0x08,0x08,0x08,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x08,0x08,0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08, 0x0C,0x0C,0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x02,0x02,0x03,0x03,0x04,0x04,0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x01,0x01,0x05,0x05,0x03,0x03,0x02,0x02,0x02,0x02,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,
}; };

View File

@ -2,14 +2,18 @@
#include <stdint.h> #include <stdint.h>
#include "sprites.h" #include "sprites.h"
uint16_t sprites_pal[9] = { uint16_t sprites_pal[13] = {
0xFFFF, // 00 :: rgb(255,255,255) 0xFFFF, // 00 :: rgb(255,255,255)
0xF7BD, // 01 :: rgb(238,238,238) 0x0000, // 01 :: rgb(0,0,0)
0x0000, // 02 :: rgb(0,0,0) 0xF7BD, // 02 :: rgb(238,238,238)
0xB5AD, // 03 :: rgb(108,108,108) 0x5AD6, // 03 :: rgb(178,178,178)
0x5AD6, // 04 :: rgb(178,178,178) 0x4A52, // 04 :: rgb(146,146,146)
0x5AD6, // 05 :: rgb(179,179,179) 0xB5AD, // 05 :: rgb(108,108,108)
0xEF7B, // 06 :: rgb(222,222,222) 0x0842, // 06 :: rgb(17,17,17)
0x4A52, // 07 :: rgb(146,146,146) 0x5AD6, // 07 :: rgb(179,179,179)
0x0000, // 08 :: rgb(0,0,0) 0x1084, // 08 :: rgb(33,33,33)
0x4A52, // 09 :: rgb(147,147,147)
0x6739, // 10 :: rgb(203,203,203)
0xEB5A, // 11 :: rgb(215,215,215)
0x0000, // 12 :: rgb(0,0,0)
}; };

View File

@ -21,7 +21,7 @@ extern uint8_t bullet_data[258];
#define baddie_size 1026 #define baddie_size 1026
extern uint8_t baddie_data[1026]; extern uint8_t baddie_data[1026];
#define baddie ((gfx_sprite_t*)baddie_data) #define baddie ((gfx_sprite_t*)baddie_data)
#define sizeof_sprites_pal 18 #define sizeof_sprites_pal 26
extern uint16_t sprites_pal[9]; extern uint16_t sprites_pal[13];
#endif #endif

View File

@ -9,24 +9,25 @@
#include <assert.h> #include <assert.h>
#include <debug.h> #include <debug.h>
#include <graphx.h> #include <graphx.h>
#include <keypadc.h>
// Graphics // Graphics
#include "gfx/sprites.h" #include "gfx/sprites.h"
// set global vars // set global vars
kb_key_t key; const int bulletAmount = 5;
const int baddieAmount = 32;
int spriteActive = 0;
float speed = 0.5; float speed = 0.5;
int i; int i;
int bulletSpawned;
int baddieSpawned;
// Include entity headers // Include entity headers
#include "player.h" #include "player.h"
#include "bullet.h" #include "bullet.h"
#include "baddie.h" #include "baddie.h"
#include "controls.h"
void setup() { void setup()
{
boot_Set48MHzModeI(); boot_Set48MHzModeI();
/* Initialize the 8bpp graphics */ /* Initialize the 8bpp graphics */
@ -38,67 +39,62 @@ void setup() {
gfx_SetPalette(sprites_pal, sizeof_sprites_pal, 0); gfx_SetPalette(sprites_pal, sizeof_sprites_pal, 0);
// Clear screen // Clear screen
gfx_FillScreen(02); gfx_FillScreen(01);
// Player starting position
player.pos.x = 10;
player.pos.y = 136;
player.oldPos.x = 10;
player.oldPos.y = 10;
// Reset all bullets
for (i = 0; i < bulletAmount; i++)
{
bullets[i].dead = true;
bullets[i].pos.x = 0;
bullets[i].pos.y = 0;
}
// Reset all baddies
for (i = 0; i < baddieAmount; i++)
{
baddies[i].dead = true;
baddies[i].pos.x = 0;
baddies[i].pos.y = 0;
}
} }
void main(void) { void main(void)
{
setup(); setup();
do { do
// Scan keyboard for button presses {
kb_Scan();
// Handle user input
handleInput();
// Move all alive bullets // Move all alive bullets
updateBullets(); for (i = 0; i < bulletAmount; i++)
{
// set key to keyboard memory adress row 7 if (updateBullet(i) == 1)
key = kb_Data[7]; {
spriteActive = 1;
// Move player
//// Down
if (key & kb_Down) {
if (!(player.pos.y >= (LCD_HEIGHT - 32))) {
player.pos.y += speed;
}
}
//// Up
if (key & kb_Up) {
if (!(player.pos.y <= 0)) {
player.pos.y -= speed;
}
}
//// Left
if (key & kb_Left) {
if (!(player.pos.x <= 0)) {
player.pos.x -= speed;
}
}
//// Right
if (key & kb_Right) {
if (!(player.pos.x >= (LCD_WIDTH - 32))) {
player.pos.x += speed;
} }
} }
// Spawn bullet on 2nd press // Move all alive baddies
if (kb_Data[1] & kb_2nd) { for (i = 0; i < baddieAmount; i++)
// If bullet has already been spawned (You cannot hold the button) {
if (bulletSpawned == 0){ if (updateBaddie(i) == 1)
spawnBullet((player.pos.x + 16), (player.pos.y + 8)); {
bulletSpawned = 1; spriteActive = 1;
}
} }
// Set bulletSpawned to false if button is let loose
if (kb_Data[1] != kb_2nd){
bulletSpawned = 0;
} }
// Redraw all sprites if player pos has changed or a bullet has been spawned // Redraw player if position has changed or if a bullet has been fired
if ( (abs(player.oldPos.x - player.pos.x) >= 1) || (abs(player.oldPos.y - player.pos.y) >= 1) || bulletSpawned == 1) { updatePlayer(spriteActive);
gfx_Sprite(spaceship, player.pos.x, player.pos.y);
player.oldPos.x = player.pos.x;
player.oldPos.y = player.pos.y;
}
} while (kb_Data[6] != kb_Enter); } while (kb_Data[6] != kb_Enter);
// Close the graphics // Close the graphics

View File

@ -1,22 +1,24 @@
// player.h // player.h
struct Player { struct Player
struct pos { {
struct pos
{
float x; float x;
float y; float y;
} pos; } pos;
struct oldPos { struct oldPos
{
float x; float x;
float y; float y;
} oldPos; } oldPos;
} player; } player;
// Player starting position void updatePlayer(int bulletsAlive)
player.pos.x = 10; {
player.pos.y = 136; if ((abs(player.oldPos.x - player.pos.x) >= 1) || (abs(player.oldPos.y - player.pos.y) >= 1) || bulletsAlive == 1)
player.oldPos.x = 10; {
player.oldPos.y = 10; gfx_Sprite(spaceship, player.pos.x, player.pos.y);
player.oldPos.x = player.pos.x;
void updatePlayer(float dx, float dy) { player.oldPos.y = player.pos.y;
player.pos.x = player.pos.x + dx; }
player.pos.y = player.pos.y + dy;
} }