Skip to content

Commit

Permalink
Create background map.
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroldo de Oliveira Pinheiro committed Nov 13, 2021
1 parent 03ff957 commit a6468c7
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ OBJS := data.rel actor.rel map.rel shot.rel score.rel binary_gunner.rel

all: $(PRJNAME).sms

data.c: data/* data/sprites_tiles.psgcompr data/tileset_tiles.psgcompr \
data/path1.path data/path2.path data/path3.path data/path4.path
data.c: data/* data/sprites_tiles.psgcompr data/tileset_tiles.psgcompr data/level1.bin \
data/path1.path data/path2.path data/path3.path data/path4.path
folder2c data data

data/sprites_tiles.psgcompr: data/img/sprites.png
Expand All @@ -24,6 +24,9 @@ data/path3.path: data/path/path3.spline.json

data/path4.path: data/path/path4.spline.json
node tool/convert_splines.js data/path/path4.spline.json data/path4.path

data/level1.bin: data/map/level1.tmx
node tool/convert_map.js data/map/level1.tmx data/level1.bin

%.vgm: %.wav
psgtalk -r 512 -u 1 -m vgm $<
Expand Down
7 changes: 7 additions & 0 deletions binary_gunner.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ void main() {
SMS_loadPSGaidencompressedTiles(tileset_tiles_psgcompr, 256);
load_standard_palettes();

init_map(level1_bin);
draw_map_screen();

SMS_displayOn();

init_actor(&player, 116, PLAYER_BOTTOM - 16, 2, 1, 2, 1);
Expand Down Expand Up @@ -338,6 +341,10 @@ void main() {
SMS_finalizeSprites();
SMS_waitForVBlank();
SMS_copySpritestoSAT();

// Scroll two lines per frame
draw_map();
draw_map();
}
}

Expand Down
Binary file modified data/img/tileset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/img/tileset.xcf
Binary file not shown.
Binary file added data/level1.bin
Binary file not shown.
108 changes: 108 additions & 0 deletions data/map/level1.tmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.5" tiledversion="2021.03.23" orientation="orthogonal" renderorder="right-down" width="16" height="100" tilewidth="16" tileheight="16" infinite="0" nextlayerid="2" nextobjectid="1">
<tileset firstgid="1" source="tileset.tsx"/>
<layer id="1" name="Camada de Tiles 1" width="16" height="100">
<data encoding="csv">
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,3,3,3,3,3,3,3,3,3,3,3,4,1,
1,18,1,2,3,3,3,3,3,3,3,3,4,1,20,1,
1,18,1,18,1,1,2,3,3,4,1,1,20,1,20,1,
1,18,1,18,1,1,18,19,19,20,1,1,20,1,20,1,
1,18,1,18,1,1,34,35,35,36,1,1,20,1,20,1,
1,18,1,18,1,1,1,1,1,1,1,1,20,1,20,1,
1,18,1,34,35,35,35,35,35,35,35,35,36,1,20,1,
1,34,35,35,35,35,35,35,35,35,35,35,35,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,1,1,1,1,1,1,1,2,3,4,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,34,35,36,1,1,1,1,1,1,1,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,1,1,1,1,1,1,1,2,3,4,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,34,35,36,1,1,1,1,1,1,1,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,2,3,3,3,3,4,1,2,3,4,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,34,35,36,1,34,35,35,35,35,36,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,2,3,3,3,3,4,1,2,3,4,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,1,20,1,18,1,1,1,1,20,1,18,1,20,1,
1,18,19,20,1,18,19,1,1,19,20,1,18,19,20,1,
1,34,35,36,1,34,35,35,35,35,36,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,1,1,1,1,1,1,1,2,3,4,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,18,1,20,1,1,1,1,1,1,1,1,18,1,20,1,
1,18,1,20,1,1,1,1,1,1,1,1,18,1,20,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,18,1,20,1,1,1,1,1,1,1,1,18,1,20,1,
1,18,1,20,1,1,2,3,3,4,1,1,18,1,20,1,
1,18,19,20,1,1,18,19,1,20,1,1,18,19,20,1,
1,34,35,36,1,1,18,1,1,20,1,1,34,35,36,1,
1,1,1,1,1,1,18,1,1,20,1,1,1,1,1,1,
1,1,1,1,1,1,18,19,1,20,1,1,1,1,1,1,
1,1,1,1,1,1,18,1,1,20,1,1,1,1,1,1,
1,1,1,1,1,1,18,1,1,20,1,1,1,1,1,1,
1,1,1,1,1,1,18,19,19,20,1,1,1,1,1,1,
1,1,1,1,1,1,34,35,35,36,1,1,1,1,1,1,
1,2,3,4,1,1,1,1,1,1,1,1,2,3,4,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,18,1,20,1,1,1,1,1,1,1,1,18,1,20,1,
1,18,1,20,1,1,1,1,1,1,1,1,18,1,20,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,18,1,20,1,1,1,1,1,1,1,1,18,1,20,1,
1,18,1,20,1,1,1,1,1,1,1,1,18,1,20,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,34,35,36,1,1,1,1,1,1,1,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,1,1,1,1,1,1,1,2,3,4,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,34,35,36,1,1,1,1,1,1,1,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,1,1,1,1,1,1,1,2,3,4,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,34,35,36,1,1,1,1,1,1,1,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,1,1,1,1,1,1,1,2,3,4,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,34,35,36,1,1,1,1,1,1,1,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,3,4,1,1,1,1,1,1,1,1,2,3,4,1,
1,18,19,20,1,1,1,1,1,1,1,1,18,19,20,1,
1,34,35,36,1,1,1,1,1,1,1,1,34,35,36,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
</data>
</layer>
</map>
4 changes: 4 additions & 0 deletions data/map/tileset.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.5" tiledversion="2021.03.23" name="tileset" tilewidth="16" tileheight="16" tilecount="48" columns="16">
<image source="../img/tileset.png" width="256" height="48"/>
</tileset>
Binary file modified data/tileset_tiles.psgcompr
Binary file not shown.

0 comments on commit a6468c7

Please sign in to comment.