Skip to content

Commit 7270ebf

Browse files
committed
Changed level design
1 parent 3b1434a commit 7270ebf

File tree

5 files changed

+45
-35
lines changed

5 files changed

+45
-35
lines changed

TileMap.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,12 @@ class TileMapRenderer {
5454
TileMapRenderer() {
5555
// Load all tile definitions
5656
loadTile('#', "assets/images/WallLowM.png", TileAsset::Type::Wall);
57-
loadTile('<', "assets/images/WallLowL.png", TileAsset::Type::Wall);
58-
loadTile('>', "assets/images/WallLowR.png", TileAsset::Type::Wall);
59-
loadTile('[', "assets/images/WallHighL.png", TileAsset::Type::Wall);
60-
loadTile(']', "assets/images/WallHighR.png", TileAsset::Type::Wall);
61-
loadTile('_', "assets/images/WallHighM.png", TileAsset::Type::Wall);
6257
loadTile('L', "assets/images/WallSideL.png", TileAsset::Type::Wall);
6358
loadTile('R', "assets/images/WallSideR.png", TileAsset::Type::Wall);
6459
loadTile('U', "assets/images/WallSideU.png", TileAsset::Type::Wall);
60+
loadTile('l', "assets/images/WallSideL.png", TileAsset::Type::Wall);
61+
loadTile('r', "assets/images/WallSideR.png", TileAsset::Type::Wall);
62+
loadTile('u', "assets/images/WallSideU.png", TileAsset::Type::Wall);
6563

6664
loadTile('.', "assets/images/Floor.png", TileAsset::Type::Floor);
6765
loadTile(',', "assets/images/Grass.png", TileAsset::Type::Floor);
@@ -103,7 +101,7 @@ class TileMapRenderer {
103101
window.draw(sprite);
104102
// Should still draw a floor even if there is another object there
105103
// It will decide the texture of the floor by looking at nearby floors
106-
} else if (tile != 'U' && tile != 'L' && tile != 'R') {
104+
} else if (tile != 'U' && tile != 'L' && tile != 'R' && tile != '%') {
107105
// Count nearby floor symbols
108106
std::map<char,int> counts;
109107
for (int dy = -1; dy <= 1; ++dy) {

level.txt

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
1-
L_____________RL_______________________R,,,,,,
2-
L#############RL#######################R,,,,,,
3-
L.............RL.......................R,,,,,,
4-
L....G...P....RL...E.....G.......H.....R,,,,,,
5-
L.............RL.......................R,,,,,,
6-
L.....[________]..........[_______]....R,,,,,,
7-
###...##########..#####...<#######>...##,,,,,,
8-
#......<>..........#.............#,,,,,#,,,,,,
9-
#......<>.C....E.._#....G....H...#,,,,,#----->
10-
#.E..__<>.........-#.............#,,,,,#_____>
11-
##>.<#####...#############...######...#######>
12-
#........#.............#................,,,,,,
13-
#..H.....#....G....C...#....E......G....,,,,,,
14-
#........#.............#................,,,,,,
15-
###...#########...#########...##########,,,,,,
16-
#...........#.........#................#,,,,,,
17-
#..H..G.....#..E......#...H....E.......#,,,,,,
18-
#...........#.........#................#,,,,,,
19-
#....##...########....#####...#####....#,,,,,,
20-
#....#...........#....#...........#....#,,,,,,
21-
#....#....C..G...#.E..#.....C.....#..H.#,,,,,,
22-
#....#...........#....#...........#....#,,,,,,
23-
#....#####...#####....#####...#####....R,,,,,,
24-
#......................................R,,,,,,
25-
L..E...........H...........G..E........R,,,,,,
26-
L....G.........E.......................R,,,,,,
27-
.UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU.,,,,,,
1+
LUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUR
2+
LL##########%#######%##########RR
3+
LL##########%#######%##########RR
4+
LL.........l%r.....l%r.........RR
5+
LL.C....E..l%r..P..l%r..E....C.RR
6+
LL.........l%r.....l%r.........RR
7+
LL.........l%r.....l%r.........RR
8+
L%UUUUUUrlUU%r.....l%UUrlUUUUUU%R
9+
LL######rl##%r.....l%##rl######RR
10+
LL######rl##%r..E..l###rl######RR
11+
LL.........l%r.....l#r.........RR
12+
LL...H.....l%r.............G...RR
13+
LL......E..l%r..........E....H.RR
14+
LL.........l%r.....lUr.........RR
15+
L%UrlUUUUUUU%r.....l%UUUUUUUUUU%R
16+
LL#rl#######%r.....l%##########RR
17+
LL#rl########r..E..l%##########RR
18+
LL.........l#r.....l%r.........RR
19+
LL.................l%r.........RR
20+
LL.C....E..........l%r..E....C.RR
21+
LL.........lUr.....l%r.........RR
22+
L%UUUUUUUUUU%r.....l%UUrlUUUUUU%R
23+
LL###########r.....l###rl######RR
24+
LL###########r.....l###rl######RR
25+
LL.............................RR
26+
LL.............E....G......H...RR
27+
LL........G....................RR
28+
LL...H............G............RR
29+
LL.............................RR
30+
L%UUUUUUrlUUUr.....lUUUrlUUUUUU%R
31+
LL######rl##%r.....l%##rl######RR
32+
LL######rl##%r..E..l%##rl######RR
33+
LL.........l%r.....l%r.........RR
34+
LL.........l%r.....l%r.........RR
35+
LL.C....E..l%r.....l%r..E....C.RR
36+
LL.........l%r.....l%r.........RR
37+
L%UUUUUUUUUU%UUUUUUU%UUUUUUUUUU%R
38+
L###############################R
39+
L###############################R

main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ int main()
9999
// Find player and walls
100100
for (int y = 0; y < size.y; ++y) {
101101
for (int x = 0; x < size.x; ++x) {
102-
if (map.getTile(x, y) == '#') {
102+
if (map.getTile(x, y) == '#' || map.getTile(x, y) == 'U' || map.getTile(x, y) == 'L' || map.getTile(x, y) == 'R' || map.getTile(x, y) == '%') {
103103
grid.nodes[y][x].wall = true;
104104
}
105105
if (map.getTile(x, y) == 'P') {
@@ -143,7 +143,7 @@ int main()
143143
for (int y = 0; y < size.y; ++y) { // Height
144144
for (int x = 0; x < size.x; ++x) { // Width
145145
// Walls
146-
if (map.getTile(x, y) == '#') {
146+
if (map.getTile(x, y) == '#' || map.getTile(x, y) == 'U' || map.getTile(x, y) == 'L' || map.getTile(x, y) == 'R' || map.getTile(x, y) == '%') {
147147
Object wall;
148148
wall.pos = Vec2(x * TILE_SIZE + TILE_SIZE / 2.0f, y * TILE_SIZE + TILE_SIZE / 2.0f);
149149
wall.aabb.min = Vec2(x * TILE_SIZE, y * TILE_SIZE);

main.exe

0 Bytes
Binary file not shown.

main.obj

-933 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)