Skip to content

Commit

Permalink
Merge pull request #83 from wendelscardua/82-tweak-maps
Browse files Browse the repository at this point in the history
Tweak maps
  • Loading branch information
wendelscardua authored Dec 1, 2021
2 parents c679d8c + a700758 commit 877a10c
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 26 deletions.
Binary file modified assets/sectors/sector-00.bin
Binary file not shown.
Binary file modified assets/sectors/sector-00.rle
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/sectors/sector-00.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<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,2,2,2,2,1,1,1,1,
2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,3,2,
2,4,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,
1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,2,2,2,2,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
</data>
Expand Down
Binary file modified assets/sectors/sector-02.bin
Binary file not shown.
Binary file modified assets/sectors/sector-02.rle
Binary file not shown.
4 changes: 2 additions & 2 deletions assets/sectors/sector-02.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
1,1,1,2,2,2,2,2,2,1,1,1,
1,1,2,2,2,2,2,2,2,2,1,1,
1,2,2,2,2,2,2,2,2,2,2,1,
2,2,2,2,2,4,2,2,2,2,2,2,
2,2,2,2,2,2,3,2,2,2,2,2,
2,2,2,2,4,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,3,2,2,2,2,
1,2,2,2,2,2,2,2,2,2,2,1,
1,1,2,2,2,2,2,2,2,2,1,1,
1,1,1,2,2,2,2,2,2,1,1,1,
Expand Down
Binary file modified assets/sectors/sector-04.bin
Binary file not shown.
Binary file modified assets/sectors/sector-04.rle
Binary file not shown.
12 changes: 6 additions & 6 deletions assets/sectors/sector-04.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<data encoding="csv">
2,2,2,1,2,2,2,2,1,2,2,2,
2,2,2,2,2,2,2,2,2,2,3,2,
2,2,2,1,2,2,2,2,1,2,2,2,
1,2,1,1,2,2,2,2,1,1,2,1,
1,2,1,1,1,1,1,1,1,1,2,1,
1,2,1,1,1,1,1,1,1,1,2,1,
1,2,1,1,2,2,2,2,1,1,2,1,
2,2,2,1,2,2,2,2,1,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,
1,2,2,1,2,2,2,2,1,2,2,1,
1,2,2,1,1,1,1,1,1,2,2,1,
1,2,2,1,1,1,1,1,1,2,2,1,
1,2,2,1,2,2,2,2,1,2,2,1,
2,2,2,2,2,2,2,2,2,2,2,2,
2,4,2,2,2,2,2,2,2,2,2,2,
2,2,2,1,2,2,2,2,1,2,2,2
</data>
Expand Down
Binary file modified assets/sectors/sector-05.bin
Binary file not shown.
Binary file modified assets/sectors/sector-05.rle
Binary file not shown.
20 changes: 10 additions & 10 deletions assets/sectors/sector-05.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<tileset firstgid="1" source="metatiles.tsx"/>
<layer id="1" name="Tile Layer 1" width="12" height="10">
<data encoding="csv">
2,2,2,2,2,1,1,1,1,2,2,2,
2,2,2,2,2,1,1,1,1,2,4,2,
2,2,2,2,2,1,1,1,1,2,2,2,
2,2,2,2,2,2,1,1,1,1,2,1,
2,2,2,2,2,2,2,2,1,1,2,1,
1,2,1,1,2,2,2,2,2,2,2,2,
1,2,1,1,1,1,2,2,2,2,2,2,
2,2,2,1,1,1,1,2,2,2,2,2,
2,3,2,1,1,1,1,2,2,2,2,2,
2,2,2,1,1,1,1,2,2,2,2,2
2,2,2,2,2,1,1,1,2,2,2,2,
2,2,2,2,2,1,1,1,2,2,4,2,
2,2,2,2,2,1,1,1,2,2,2,2,
2,2,2,2,2,2,1,1,1,2,2,1,
2,2,2,2,2,2,2,2,1,2,2,1,
1,2,2,1,2,2,2,2,2,2,2,2,
1,2,2,1,1,1,2,2,2,2,2,2,
2,2,2,2,1,1,1,2,2,2,2,2,
2,3,2,2,1,1,1,2,2,2,2,2,
2,2,2,2,1,1,1,2,2,2,2,2
</data>
</layer>
<objectgroup id="2" name="Rooms">
Expand Down
Binary file modified assets/sectors/sector-06.bin
Binary file not shown.
Binary file modified assets/sectors/sector-06.rle
Binary file not shown.
2 changes: 1 addition & 1 deletion assets/sectors/sector-06.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<data encoding="csv">
1,2,2,2,2,1,1,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,4,2,
2,2,2,2,2,1,1,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,
2,1,1,2,2,1,1,1,1,2,2,1,
2,1,2,2,2,2,1,1,2,2,2,2,
2,1,2,2,3,2,1,1,2,2,2,2,
Expand Down
Binary file modified assets/sectors/sector-07.bin
Binary file not shown.
Binary file modified assets/sectors/sector-07.rle
Binary file not shown.
6 changes: 3 additions & 3 deletions assets/sectors/sector-07.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<tileset firstgid="1" source="metatiles.tsx"/>
<layer id="1" name="Tile Layer 1" width="12" height="10">
<data encoding="csv">
2,2,2,1,1,1,1,1,1,2,2,2,
2,2,2,1,2,2,2,2,1,2,2,2,
2,2,2,2,2,4,3,2,2,2,2,2,
2,2,2,2,2,4,2,2,2,2,2,2,
2,2,2,2,2,2,3,2,2,2,2,2,
2,2,2,1,2,2,2,2,1,2,2,2,
2,2,2,1,1,1,1,1,1,2,2,2,
2,2,2,1,1,1,1,1,1,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,1,1,1,1,1,1,2,2,2,
2,2,2,1,2,2,2,2,1,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,
Expand Down
6 changes: 5 additions & 1 deletion src/dungeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ unsigned char * current_sector;
unsigned char * current_sector_room_data;
unsigned char current_dungeon_index, current_sector_index;


void generate_layout() {
_Static_assert(NUM_SECTOR_TEMPLATES == 8 || NUM_SECTOR_TEMPLATES == 16 || NUM_SECTOR_TEMPLATES == 32 || NUM_SECTOR_TEMPLATES == 64 || NUM_SECTOR_TEMPLATES == 128);
for(temp_y = 0; temp_y < NUM_DUNGEONS; temp_y++) {
for(temp_x = 0; temp_x < NUM_SECTORS; temp_x++) {
dungeon_layout[temp_y][temp_x] = rand8() % NUM_SECTOR_TEMPLATES;
do {
dungeon_layout[temp_y][temp_x] = temp = rand8() & (NUM_SECTOR_TEMPLATES-1);
} while(temp_x > 0 && temp == dungeon_layout[temp_y][temp_x - 1]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/entities.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void init_entities(unsigned char stairs_row, unsigned char stairs_col) {
temp_h = *room_ptr;
++room_ptr;

if (subrand8(1)) { // 50% chance to spawn in room
if (subrand8(3) > 0) { // 75% chance to spawn in room
spawn_enemy(num_entities);
entity_col[num_entities] = temp_x + subrand8(temp_w);
entity_row[num_entities] = temp_y + subrand8(temp_h);
Expand Down

0 comments on commit 877a10c

Please sign in to comment.