summaryrefslogtreecommitdiff
path: root/src/player.c
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-03-01 12:47:01 +0300
committerAleksey Veresov <aleksey@veresov.pro>2021-03-01 12:47:01 +0300
commit7fbb9c444057fe3f30da0bac4d52fd8c6e8ba59b (patch)
treefc407dc77b1464300e400135df97855123ed9535 /src/player.c
parenta365de1b0ab91f9c057196a601d96d2aed6e48fb (diff)
downloadtakethis-7fbb9c444057fe3f30da0bac4d52fd8c6e8ba59b.tar
takethis-7fbb9c444057fe3f30da0bac4d52fd8c6e8ba59b.tar.xz
takethis-7fbb9c444057fe3f30da0bac4d52fd8c6e8ba59b.zip
O_o
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/player.c b/src/player.c
index 10d5c5f..daf4a96 100644
--- a/src/player.c
+++ b/src/player.c
@@ -1,5 +1,6 @@
#include "player.h"
+#include <math.h>
#include "globals.h"
@@ -46,16 +47,20 @@ void tt_player_draw()
if (ttplayer.xwalk == 1) dir = 6;
else if (ttplayer.xwalk == -1) dir = 2;
else if (ttplayer.ywalk == -1) dir = 4;
- SDL_Rect s = { 16 * (dir + (ttplayer.rem / 100 % 2)),
- 16 * (5 + ttplayer.variant),
+ SDL_Rect s = { 16 * (8 * ttplayer.variant +
+ dir + (ttplayer.rem / 100 % 2)),
+ 16 * 5,
16, 16 };
SDL_RenderCopy(ttrdr, tttxr, &s, &d);
- for (i = 0; i != TT_ROOM_H; ++i) {
- for (j = 0; j != TT_ROOM_W; ++j) {
- SDL_Rect d = { 14 + j * 32, 14 + i * 32, 32, 32 };
- SDL_Rect *roof = r->roof[i][j];
- if (roof) SDL_RenderCopy(ttrdr, tttxr, roof, &d);
- }
+ if (ttplayer.until_gulag > 0) {
+ double r = ttplayer.until_gulag / 10;
+ double f = (double)(ttplayer.until_gulag) / 3000 *
+ 2 * 3.14159265358979323846;
+ SDL_Rect s = { 0, 16 * 11, 16, 32 };
+ SDL_Rect d = { ttplayer.x + r * cos(f),
+ ttplayer.y - 16 + r * sin(f),
+ 32, 64 };
+ SDL_RenderCopy(ttrdr, tttxr, &s, &d);
}
}