Initial Commit
This commit is contained in:
17
z_gbdk_playground_original/move_sprite/Makefile
Normal file
17
z_gbdk_playground_original/move_sprite/Makefile
Normal 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) *~
|
||||
|
6
z_gbdk_playground_original/move_sprite/README.md
Normal file
6
z_gbdk_playground_original/move_sprite/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Move Sprite
|
||||
|
||||

|
||||
|
||||
Demonstrates how to move a sprite using the d-pad.
|
||||
|
37
z_gbdk_playground_original/move_sprite/move_sprite.c
Normal file
37
z_gbdk_playground_original/move_sprite/move_sprite.c
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
BIN
z_gbdk_playground_original/move_sprite/screenshot.gif
Normal file
BIN
z_gbdk_playground_original/move_sprite/screenshot.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
32
z_gbdk_playground_original/move_sprite/ufo.c
Normal file
32
z_gbdk_playground_original/move_sprite/ufo.c
Normal 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 */
|
BIN
z_gbdk_playground_original/move_sprite/ufo.gbr
Normal file
BIN
z_gbdk_playground_original/move_sprite/ufo.gbr
Normal file
Binary file not shown.
31
z_gbdk_playground_original/move_sprite/ufo.h
Normal file
31
z_gbdk_playground_original/move_sprite/ufo.h
Normal 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 */
|
Reference in New Issue
Block a user