Initial Commit

This commit is contained in:
2020-07-11 08:41:14 -05:00
parent 55c0f7f3cd
commit 1478a597cf
176 changed files with 11933 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
AS = lcc -c
CC = lcc -Wa-l -Wl-m
BIN = simple_shmup.gb
OBJS = simple_shmup.o bank2.o bank3.o
all: $(BIN)
%.s: %.ms
maccer -o $@ $<
$(BIN): $(OBJS)
$(CC) -o $(BIN) $(OBJS)
clean:
rm -rf $(BIN) $(OBJS) *~

View File

@@ -0,0 +1,8 @@
# Simple SHMUP
![](screenshot.png)
A simple side-scrolling shoot 'em up game. This example uses several small
sprites, a scrolling background and a full-screen image.
Tutorial: [How to write a simple side scrolling game in GBDK](https://pastebin.com/F3tHLj68) by Jason

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,154 @@
#include <gb/gb.h>
#include <gb/drawing.h>
#include <rand.h>
const UBYTE badguy_ai[] = {
32, 32, 33, 34, 35, 35, 36, 37,
38, 38, 39, 40, 41, 41, 42, 43,
44, 44, 45, 46, 46, 47, 48, 48,
49, 50, 50, 51, 51, 52, 53, 53,
54, 54, 55, 55, 56, 56, 57, 57,
58, 58, 58, 59, 59, 60, 60, 60,
61, 61, 61, 61, 62, 62, 62, 62,
62, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 63, 63, 63,
62, 62, 62, 62, 62, 61, 61, 61,
61, 60, 60, 60, 59, 59, 59, 58,
58, 57, 57, 56, 56, 55, 55, 54,
54, 53, 53, 52, 52, 51, 50, 50,
49, 49, 48, 47, 47, 46, 45, 44,
44, 43, 42, 42, 41, 40, 39, 39,
38, 37, 36, 36, 35, 34, 33, 33,
32, 31, 30, 29, 29, 28, 27, 26,
26, 25, 24, 23, 23, 22, 21, 20,
20, 19, 18, 18, 17, 16, 16, 15,
14, 14, 13, 12, 12, 11, 11, 10,
9, 9, 8, 8, 7, 7, 6, 6,
6, 5, 5, 4, 4, 4, 3, 3,
3, 2, 2, 2, 1, 1, 1, 1,
1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 2, 2,
2, 3, 3, 3, 4, 4, 4, 5,
5, 5, 6, 6, 7, 7, 8, 8,
9, 9, 10, 11, 11, 12, 12, 13,
14, 14, 15, 16, 16, 17, 18, 18,
19, 20, 20, 21, 22, 23, 23, 24,
25, 26, 26, 27, 28, 29, 29, 30
};
UBYTE playing, joypad_state;
UBYTE player_x, player_y;
UBYTE badguy_x, badguy_y, badguy_z, badguy_offset;
UBYTE player_shot_x, player_shot_y, player_shot_z;
void update_graphics(void) {
disable_interrupts();
scroll_bkg(1, 0);
move_sprite(0, player_x, player_y);
move_sprite(1, badguy_x, badguy_y);
move_sprite(2, player_shot_x, player_shot_y);
enable_interrupts();
}
void update_joypad(void) {
joypad_state = joypad();
if(joypad_state & J_LEFT) {
if(player_x > 8)
player_x--;
}
if(joypad_state & J_RIGHT) {
if(player_x < 160)
player_x++;
}
if(joypad_state & J_UP) {
if(player_y > 16)
player_y--;
}
if(joypad_state & J_DOWN) {
if(player_y < 152)
player_y++;
}
if(joypad_state & J_A) {
if(player_shot_z == 0) {
player_shot_z = 1;
player_shot_x = player_x;
player_shot_y = player_y;
}
}
if(player_shot_z == 1) {
player_shot_x = player_shot_x + 2;
if(player_shot_x > 240) {
player_shot_x = 250;
player_shot_y = 250;
player_shot_z = 0;
}
}
}
void update_badguy(void) {
badguy_x = badguy_x - 1;
if(badguy_x > 240) {
badguy_offset = rand();
while(badguy_offset > 134) {
badguy_offset = rand();
}
badguy_x = 239;
}
badguy_y = badguy_offset + badguy_ai[badguy_z];
badguy_z++;
}
void collision_detection(void) {
if(player_shot_y > badguy_y - 4) {
if(player_shot_y < badguy_y + 4) {
if(player_shot_x > badguy_x - 4) {
if(player_shot_x < badguy_x + 4) {
player_shot_z = 0;
player_shot_x = 250;
player_shot_y = 250;
badguy_x = 255;
}
}
}
}
if(player_y > badguy_y - 4) {
if(player_y < badguy_y + 4) {
if(player_x > badguy_x - 4) {
if(player_x < badguy_x + 4) {
playing = 0;
delay(1000);
}
}
}
}
}
void do_gameplay(void) {
playing = 1;
player_x = GRAPHICS_WIDTH / 2;
player_y = GRAPHICS_HEIGHT / 2;
while(playing == 1) {
update_joypad();
update_badguy();
collision_detection();
delay(10);
}
}

View File

@@ -0,0 +1,90 @@
#include <gb/gb.h>
#include "bg_title.c"
#include "bg_title.map"
#include "bg_tile.c"
#include "spr_tiles.c"
const UBYTE gamemap[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
const UWORD bgpal[] = {
RGB(0, 0, 0), RGB(10, 10, 10), RGB(20, 20, 20), RGB(30, 30, 30),
};
const UWORD spritepal[] = {
RGB(0, 0, 0), RGB(10, 10, 10), RGB(20, 20, 20), RGB(30, 30, 30),
};
void draw_title_screen(void) {
wait_vbl_done();
DISPLAY_OFF;
set_bkg_data(0, 255, bg_title_tiledata);
set_bkg_tiles(0, 0, 20, 18, bg_title_tilemap);
SHOW_BKG;
HIDE_WIN;
HIDE_SPRITES;
wait_vbl_done();
DISPLAY_ON;
waitpad(255);
}
void load_game_tiles(void) {
wait_vbl_done();
DISPLAY_OFF;
set_bkg_data(0, 1, BGTile);
set_bkg_tiles(0, 0, 32, 32, gamemap);
set_bkg_palette(0, 1, &bgpal[0]);
set_sprite_data(0, 3, SpriteTiles);
set_sprite_tile(0, 0);
set_sprite_tile(1, 1);
set_sprite_tile(2, 2);
SPRITES_8x8;
SHOW_SPRITES;
SHOW_BKG;
DISPLAY_ON;
}

View File

@@ -0,0 +1,32 @@
/*
BG_TILE.C
Tile Source File.
Info:
Form : All tiles as one unit.
Format : Gameboy 4 color.
Compression : None.
Counter : None.
Tile size : 8 x 8
Tiles : 0 to 0
Palette colors : None.
SGB Palette : None.
CGB Palette : None.
Convert to metatiles : No.
This file was generated by GBTD v2.2
*/
/* Start of tile array. */
const unsigned char BGTile[] =
{
0xFF,0xFF,0xFB,0xFB,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0x7F,0x7F,0xF7,0xF7,0xFF,0xFF
};
/* End of BG_TILE.C */

View File

@@ -0,0 +1,31 @@
/*
BG_TILE.H
Include File.
Info:
Form : All tiles as one unit.
Format : Gameboy 4 color.
Compression : None.
Counter : None.
Tile size : 8 x 8
Tiles : 0 to 0
Palette colors : None.
SGB Palette : None.
CGB Palette : None.
Convert to metatiles : No.
This file was generated by GBTD v2.2
*/
/* Bank of tiles. */
#define BGTileBank 0
/* Start of tile array. */
extern unsigned char BGTile[];
/* End of BG_TILE.H */

View File

@@ -0,0 +1,170 @@
/*
Advanced PCX to GameBoy converter v2.15
Tiles data
Original PCX File : "BG.PCX"
Number of Tiles : 159
TileMap Size : 20x18
*/
const unsigned char bg_title_tiledata[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xDF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xDF,0xDF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x30,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0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c -Wa-l -Wl-m -Wl-j -Wl-yt0x01 -Wl-yo4 -o simple_shmup.gb simple_shmup.o bank2.o bank3.o
rem -Wl-yp0x143=0x80

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@@ -0,0 +1,58 @@
#include <gb/gb.h>
#include <rand.h>
#include <stdio.h>
// bank 0
void vblint(void);
// bank 2
void update_graphics(void);
void do_gameplay(void);
void update_joypad(void);
void update_badguy(void);
void collision_detection(void);
// bank 3
void draw_title_screen(void);
void load_game_tiles(void);
fixed seed;
// main
void main() {
seed.b.l = DIV_REG;
SWITCH_ROM_MBC1(3);
draw_title_screen();
seed.b.h = DIV_REG;
initrand(seed.w);
load_game_tiles();
disable_interrupts();
add_VBL(vblint);
SWITCH_ROM_MBC1(2);
enable_interrupts();
do_gameplay();
reset();
}
void vblint(void) {
SWITCH_ROM_MBC1(2);
update_graphics();
}

View File

@@ -0,0 +1,36 @@
/*
SPR_TILES.C
Tile Source File.
Info:
Form : All tiles as one unit.
Format : Gameboy 4 color.
Compression : None.
Counter : None.
Tile size : 8 x 8
Tiles : 0 to 2
Palette colors : None.
SGB Palette : None.
CGB Palette : None.
Convert to metatiles : No.
This file was generated by GBTD v2.2
*/
/* Start of tile array. */
const unsigned char SpriteTiles[] =
{
0x40,0x40,0xE0,0xA0,0xFE,0x80,0xC8,0xB8,
0x8C,0xF4,0x96,0xEA,0xA9,0xD7,0xFF,0xFF,
0x02,0x40,0xC5,0xA3,0xE5,0xBB,0xF5,0xAB,
0xF5,0xAB,0xF5,0xAB,0xFD,0xBB,0x42,0x42,
0x00,0x00,0x00,0x18,0x18,0x3C,0x3C,0x66,
0x3C,0x66,0x18,0x3C,0x00,0x18,0x00,0x00
};
/* End of SPR_TILES.C */

View File

@@ -0,0 +1,31 @@
/*
SPR_TILES.H
Include File.
Info:
Form : All tiles as one unit.
Format : Gameboy 4 color.
Compression : None.
Counter : None.
Tile size : 8 x 8
Tiles : 0 to 2
Palette colors : None.
SGB Palette : None.
CGB Palette : None.
Convert to metatiles : No.
This file was generated by GBTD v2.2
*/
/* Bank of tiles. */
#define SpriteTilesBank 0
/* Start of tile array. */
extern unsigned char SpriteTiles[];
/* End of SPR_TILES.H */

Binary file not shown.