From f57c37b9001ef55cbfe4f6504734f2fd57e7e651 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 23 Sep 2025 12:40:26 -0700 Subject: [PATCH] fixed a divison thingy --- source/game.c | 2 +- source/sprite.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/game.c b/source/game.c index 5ec270b..d12112d 100644 --- a/source/game.c +++ b/source/game.c @@ -32,7 +32,7 @@ static uint rng_seed = 0; static uint timer = 0; // This might already exist in libtonc but idk so i'm just making my own -static int game_speed = 1; // BY DEFAULT IS SET TO 1, but if changed to 2 - 8, should speed up all (or most) of the game aspects that should be sped up by speed, as in the original game. +static int game_speed = 1; // BY DEFAULT IS SET TO 1, but if changed to 2 or more, should speed up all (or most) of the game aspects that should be sped up by speed, as in the original game. static int background = 0; static enum GameState game_state = GAME_SPLASH_SCREEN; // The current game state, this is used to determine what the game is doing at any given time diff --git a/source/sprite.c b/source/sprite.c index 199b2ab..b303d2e 100644 --- a/source/sprite.c +++ b/source/sprite.c @@ -158,8 +158,8 @@ void sprite_object_reset_transform(SpriteObject* sprite_object) void sprite_object_update(SpriteObject* sprite_object) { - sprite_object->vx += (sprite_object->tx - sprite_object->x) / (8 / get_game_speed()); // SPEED - sprite_object->vy += (sprite_object->ty - sprite_object->y) / (8 / get_game_speed()); // this makes the game_speed not be + sprite_object->vx += ((sprite_object->tx - sprite_object->x) * get_game_speed()) / 8; // SPEED + sprite_object->vy += ((sprite_object->ty - sprite_object->y) * get_game_speed()) / 8; // this makes the game_speed not be // able to be more than 8, because of //integer division making it a divide by 0. // shouldn't be a problem since speed 9 or more