diff options
-rw-r--r-- | src/game.c | 2 | ||||
-rw-r--r-- | src/game.h | 1 | ||||
-rw-r--r-- | src/spike.c | 5 |
3 files changed, 5 insertions, 3 deletions
@@ -23,6 +23,8 @@ game_deinit(Game *this) void game_update(Game *this) { + extern double tick; + this->spike_angle = tick / 16; if (this->queue_restart_scene > 0) { if (--this->queue_restart_scene == 0) game_restart_scene(this); @@ -8,6 +8,7 @@ typedef struct Game { bool queue_next_scene; int queue_restart_scene; int player_dir; + double spike_angle; Entity entities[MAX_ENTITIES]; } Game; diff --git a/src/spike.c b/src/spike.c index 3c5a8d3..f09537f 100644 --- a/src/spike.c +++ b/src/spike.c @@ -7,9 +7,8 @@ IMPL_UPDATE() { } IMPL_END IMPL_DRAW() { - const double angle = tick / 16; - rotrect(this->pos[0], this->pos[1], 10, 10, angle); - rotrect(this->pos[0], this->pos[1], 10, 10, -angle); + rotrect(this->pos[0], this->pos[1], 10, 10, g->spike_angle); + rotrect(this->pos[0], this->pos[1], 10, 10, -g->spike_angle); } IMPL_END IMPL_INIT(spike) { |