From 92f560abade4b180809bf153cc2270949d77d32a Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Wed, 3 Mar 2021 15:52:45 +0300 Subject: o_O --- data/map/1 | 2 +- data/map/3 | 49 ++++++++++++++++++++++++++++++------------------- data/map/6 | 21 +++++++++++++++++++++ src/body.c | 2 +- src/game.c | 3 ++- src/map.c | 5 ++++- src/player.c | 2 +- 7 files changed, 60 insertions(+), 24 deletions(-) create mode 100644 data/map/6 diff --git a/data/map/1 b/data/map/1 index cf2beee..14f2be3 100644 --- a/data/map/1 +++ b/data/map/1 @@ -1,5 +1,5 @@ 5 -.230 +.630 .3.3.3r0r4r4r4r4r4r4r4r4r4r4r4r4r1.3.3.3 .3.7.3r7^3^1^0. . . . . . . ^2^1r5.3.7.3 .3.3.3r7. . . . . . . . . . . ^0r5.3.3.3 diff --git a/data/map/3 b/data/map/3 index 9276a82..273fe75 100644 --- a/data/map/3 +++ b/data/map/3 @@ -1,22 +1,33 @@ -0 -1... -r0r4r4r4r4r4r4r4rb. . rar4r4r4r4r4r4r4r1 -r7. . . . . . . . . . . . . . . . . . r5 -r7. . . . . . . . . . . ^3. . . . . . r5 -r7. . ^1. . . . . . . . . . . . . . . r5 -r7. . . . . . . . . . . . . . . . . . r5 -r7. . . . . . . . . . . . . . . $ . . r5 -r7. . . . . . . . . . . . . . . . . . r5 -r7. . . $1. . . . . . . . . . . . . . r5 -r7. . . . . . . . . . . . . . . . . . r5 -r7. . . . . . . . . . . . . . . . . . r5 -r7. . . . . . . . . . . . . . . . . . r5 -r7. . $ . . . . . . . . . . . . . . . r5 -r7. . . . . . . . . ^2. . . ^1. . . . r5 -r7. . . . ^ . . . . . . . . . . . . . r5 -r7= . . . . . . . . . . . . . . . . . r5 -r2r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r3 +a +15.4 +b0b4b4b4b4b4b4b4bb.6.6bab4b4b4b4b4b1bcbc +b7^ $ . . . . . . .3.3. . . . . . bab1bc +b7. . . . . $1* $ .3.3. * ;2$ . . . bab1 +d7.3.3.3.3.3.3.3.3.3.3. . . . . . . . b5 +d6.3.3.3.3.3.3.3.3.3.3. . . . . . . . b5 +b7. . . . . $1* . .3.3$ * . ;4. . ;4^1b5 +b7^1. . . . . . . .3.3. . . ;5. . ;5. b5 +b2b6b6b6b6b9. . . .3.3. . . . . . . . b5 +b0b4b4b4b1b7. * $ .3.3. * $1. . . . . b5 +b7^3. ^2b5b7. . . .3.3.3.3.3.3.3.3.3.3d2 +bb. k . b5b7. . . .3.3.3.3.3.3.3.3.3.3d3 +.5.5.5.5b5b7. * . .3.3$ * $1. . . . . b5 +.5.5.5.5b5b7. . . .3.3. . . . . . . . b5 +b9. . . b5b7. . * .7.7* . ^ . . . . ^ b5 +b7^2. ^3b5b7;2. . .7.7. . . . . . ^2^1b5 +b2b6b6b6b3b2b6b9r8r6r6r9b8b6b6b6b6b6b6b3 ++200+000 ++000+150 ++000+100 ++200+000 +000+000 +000+000 ++000+150 ++000-100 ++000+100 ++000-150 +000+000 -+000+000=Mario was right... Coins are mushroom people. ++025+000 ++000+000 ++000-100 ++000-150 diff --git a/data/map/6 b/data/map/6 new file mode 100644 index 0000000..f306f1e --- /dev/null +++ b/data/map/6 @@ -0,0 +1,21 @@ +3 +L6.6 +^0r0r4r4r4r4r4r4rbd0d1rar4r4r4r4r4r4r1^0 +^3r7^2.b.b.b.b.b.b.7.7.b.b.b.b.b.b^1r5^3 +^1r7^1.b^0.3^3.3^1.b.b^2.3^0.3^3.b^2r5^1 +^2r7^2.b.3r8r6r9.3.b.b.3r8r6r9.3.b^0r5^2 +^0r7^0.b^2r5.7r7^2.b.b^3r5.7r7^1.b^3r5^0 +^1r7^1.b.3rar4rb.3.b.b.3rar4rb.3.b^2r5^3 +r4rb^3.b^1.3^3.3^0.b.b^0.3^1.3^2.b^1rar4 +. . . .b.b.b.b.b.b.b.b.b.b.b.b.b.b. . .3 +. . . .b.b.b.b.b.b.b.b.b.b.b.b.b.b. . .3 +r6r9^2.b^3.3^0.3^1.b.b^2.3^1.3^0.b^2r8r6 +^3r7^0.b.3r8r6r9.3.b.b.3r8r6r9.3.b^3r5^1 +^0r7^1.b^2r5.7r7^2.b.b^3r5.7r7^1.b^1r5^0 +^2r7^3.b.3rar4rb.3.b.b.3rar4rb.3.b^0r5^3 +^1r7^0.b^3.3^0.3^1.b.b^1.3^0.3^3.b^2r5^0 +^0r7^2.b.b.b.b.b.b.b.b.b.b.b.b.b.b^3r5^1 +^3r2r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r6r3^2 ++000+000 ++000+000 ++000+000 diff --git a/src/body.c b/src/body.c index fa915bb..60e3cb9 100644 --- a/src/body.c +++ b/src/body.c @@ -33,7 +33,7 @@ void tt_body_move(int d) int eyr = b->yrem; move(b, d); { - SDL_Rect box = { b->x + 5, b->y + 2, 22, 28 }; + SDL_Rect box = { b->x + 5, b->y + 2, 24, 24 }; if (!tt_room_collide(r, &box) && !tt_room_out(r, &box)) continue; } b->x = ex; diff --git a/src/game.c b/src/game.c index 664fa0b..1d5e2d6 100644 --- a/src/game.c +++ b/src/game.c @@ -4,6 +4,7 @@ #include "map.h" #include #include +#include int magic = 0; int lenin_size = 0; @@ -986,7 +987,7 @@ void changeroom(int out) for (i = 0; i != r->bodies_count; ++i) { tt_body *b = r->bodies + i; if ((6 == b->txrrow && b->txrcol <= 1) || - b->txrrow == 11) { + b->txrrow == 10) { SDL_Rect src = { 16 * 14, 16 * 11, 32, 32 }; SDL_Rect d = { b->x + fullx + transx - 32, b->y + fully + transy - 32, 128, 128 }; diff --git a/src/map.c b/src/map.c index a08749a..d602e29 100644 --- a/src/map.c +++ b/src/map.c @@ -29,7 +29,10 @@ static SDL_Rect *newtile(int row, int col) static void loadroom(tt_room *r, FILE *f) { - int default_floor_id = fgetc(f) - '0'; + int default_floor_id = fgetc(f); + if (default_floor_id < 'a') default_floor_id -= '0'; + else + default_floor_id = default_floor_id - 'a' + 10; fgetc(f); int i, j; for (i = 0; i != 4; ++i) r->neighbours[i] = ttmap + fgetc(f); diff --git a/src/player.c b/src/player.c index abfff35..50101e7 100644 --- a/src/player.c +++ b/src/player.c @@ -104,7 +104,7 @@ void tt_player_draw() int i; for (i = 0; i != r->bodies_count; ++i) { tt_body *b = r->bodies + i; - if ((6 == b->txrrow && b->txrcol <= 1) || b->txrrow == 11) { + if ((6 == b->txrrow && b->txrcol <= 1) || b->txrrow == 10) { SDL_Rect src = { 16 * 14, 16 * 11, 32, 32 }; SDL_Rect d = { b->x - 32, b->y - 32, 128, 128 }; SDL_SetTextureColorMod(tttxr, 255, 255, 255); -- cgit v1.2.3