summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-03-01 18:02:05 +0300
committerAleksey Veresov <aleksey@veresov.pro>2021-03-01 18:02:05 +0300
commit5d973f7851d8bfbbbc57b339948995ae44fc2112 (patch)
tree440ce38a74a8f35b129790bc3b1271fad043dec2
parentec583c67456efbfdb07bb2df43b0d0eee4f7b3e2 (diff)
downloadtakethis-5d973f7851d8bfbbbc57b339948995ae44fc2112.tar
takethis-5d973f7851d8bfbbbc57b339948995ae44fc2112.tar.xz
takethis-5d973f7851d8bfbbbc57b339948995ae44fc2112.zip
o_O
-rw-r--r--data/map/L12
-rw-r--r--data/txr.bmpbin229514 -> 229514 bytes
-rw-r--r--src/game.c11
-rw-r--r--src/map.c2
-rw-r--r--src/player.c4
-rw-r--r--src/player.h2
6 files changed, 23 insertions, 8 deletions
diff --git a/data/map/L b/data/map/L
index 359c576..ace8371 100644
--- a/data/map/L
+++ b/data/map/L
@@ -1,11 +1,11 @@
5
....
-.3.3.3r0r4r4r4r4r4r4r4r4r4r4r4r4r1.3.3.3
-.3.7.3r7^3^1^0. . . . . . . ^2^1r5.3.7.3
-.3.3.3r7. . . . . . . . . . . ^0r5.3.3.3
-r0r4r4rb. . . . . . . . . . . . rar4r4r1
-r7^0^3. . . . . . . . . . . . . . . ^2r5
-r7. . . . . . . . . . . . . . . . . ^0r5
+r0r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r4r1
+r7. . . . . . . . . . . . . . . . . . r5
+r7. . . . . . . . . . . . . . . . . . r5
+r7. . . . . . . . . . . . . . . . . . r5
+r7. . . . . . . . . . . . . . . . . . r5
+r7. . . . . . . . . . . . . . . . . . r5
r7. . . . . . . . . . . . . . . . . . r5
r7. . . . . . . . . . . . . . . . . . r5
r7. . . . . . . . . . . . . . . . . . r5
diff --git a/data/txr.bmp b/data/txr.bmp
index 3170361..55c999d 100644
--- a/data/txr.bmp
+++ b/data/txr.bmp
Binary files differ
diff --git a/src/game.c b/src/game.c
index 4c6d0a6..e6fec03 100644
--- a/src/game.c
+++ b/src/game.c
@@ -15,6 +15,17 @@ static void step(int d)
if (xw || yw) {
ttplayer.rem += d;
}
+ if (ttplayer.zhiv_lenin) {
+ int oldpos = ttplayer.lenin_pos;
+ ttplayer.lenin_rem += d;
+ ttplayer.lenin_pos_rem += d * ttplayer.lenin_vel;
+ ttplayer.lenin_pos += ttplayer.lenin_pos_rem / 1000;
+ ttplayer.lenin_pos_rem = ttplayer.lenin_pos_rem % 1000;
+ if (ttplayer.lenin_pos < 64 || 32 * 16 < ttplayer.lenin_pos) {
+ ttplayer.lenin_pos = oldpos;
+ ttplayer.lenin_vel *= -1;
+ }
+ }
static int first_gulag = 1;
if (ttplayer.tobein_gulag && ttplayer.until_gulag > 0) {
if (first_gulag) {
diff --git a/src/map.c b/src/map.c
index 8e32da6..f05e2c0 100644
--- a/src/map.c
+++ b/src/map.c
@@ -87,8 +87,10 @@ static void loadroom(tt_room *r, FILE *f)
ttplayer.keys = 0;
ttplayer.the_key = 0;
ttplayer.lenin_pos = 32 * 9;
+ ttplayer.lenin_pos_rem = 0;
ttplayer.zhiv_lenin = 0;
ttplayer.lenin_rem = 0;
+ ttplayer.lenin_vel = -50;
ttplayer.variant = 0;
ttplayer.tobein_gulag = 0;
ttplayer.until_gulag = 5300;
diff --git a/src/player.c b/src/player.c
index edaa04f..b4846bf 100644
--- a/src/player.c
+++ b/src/player.c
@@ -26,14 +26,14 @@ void tt_player_draw()
if (ttplayer.zhiv_lenin) {
{
- SDL_Rect src = { 32 + 32 * (ttplayer.lenin_rem / 100 % 2),
+ SDL_Rect src = { 32 + 32 * (ttplayer.lenin_rem / 200 % 2),
16 * 11 + 4, 32, 38 };
SDL_Rect dst = { 14 + ttplayer.lenin_pos,
14 + 32 + 96 - 8 - 38 * 2, 64, 38 * 2 };
SDL_RenderCopy(ttrdr, tttxr, &src, &dst);
}
{
- SDL_Rect src = { 96 + 64 * (ttplayer.lenin_rem / 100 % 2),
+ SDL_Rect src = { 96 + 64 * (ttplayer.lenin_rem / 200 % 2),
16 * 11, 64, 48 };
SDL_Rect dst = { 14 + ttplayer.lenin_pos - 32,
110, 128, 96 };
diff --git a/src/player.h b/src/player.h
index 7c2fc56..fca14e6 100644
--- a/src/player.h
+++ b/src/player.h
@@ -22,6 +22,8 @@ typedef struct tt_player {
int until_gulag;
int lenin_pos;
+ int lenin_pos_rem;
+ int lenin_vel;
int zhiv_lenin;
int lenin_rem;
} tt_player;