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 = move_sprite.gb
OBJS = move_sprite.o ufo.o
all: $(BIN)
%.s: %.ms
maccer -o $@ $<
$(BIN): $(OBJS)
$(CC) -o $(BIN) $(OBJS)
clean:
rm -rf $(BIN) $(OBJS) *~

View File

@@ -0,0 +1,6 @@
# Move Sprite
![](screenshot.gif)
Demonstrates how to move a sprite using the d-pad.

View File

@@ -0,0 +1,37 @@
#include <gb/gb.h>
#include "ufo.c"
void main() {
int x = 55;
int y = 75;
SPRITES_8x8;
set_sprite_data(0, 0, ufo);
set_sprite_tile(0, 0);
move_sprite(0, x, y);
SHOW_SPRITES;
while(1) {
if(joypad() & J_RIGHT) {
x++;
move_sprite(0, x, y);
delay(10);
}
if(joypad() & J_LEFT) {
x--;
move_sprite(0, x, y);
delay(10);
}
if(joypad() & J_UP) {
y--;
move_sprite(0, x, y);
delay(10);
}
if(joypad() & J_DOWN) {
y++;
move_sprite(0, x, y);
delay(10);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,32 @@
/*
UFO.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. */
unsigned char ufo[] =
{
0x5A,0x3C,0xE3,0x42,0x7C,0x99,0xEB,0xA5,
0xFB,0xA5,0x66,0x99,0xE7,0x42,0x5A,0x3C
};
/* End of UFO.C */

Binary file not shown.

View File

@@ -0,0 +1,31 @@
/*
UFO.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 ufoBank 0
/* Start of tile array. */
extern unsigned char ufo[];
/* End of UFO.H */