From b264623cb1e3c7484fabad546af7aed51d88b197 Mon Sep 17 00:00:00 2001 From: Charadon Date: Thu, 9 Jun 2022 12:19:17 -0400 Subject: Fixed a timing issue --- src/ball.c | 2 +- src/enemy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ball.c b/src/ball.c index 33b2d40..a3e63ab 100644 --- a/src/ball.c +++ b/src/ball.c @@ -10,7 +10,7 @@ void ball(Rectangle *Player, Rectangle *Enemy, struct Balls *Ball, int *PlayerSc // Moves int CurrentTick = SDL_AtomicGet(&Ticks); if(Ball->NextTick <= CurrentTick){ - int RunThisManyTimes = 1; + int RunThisManyTimes = 0; if (CurrentTick > Ball->NextTick) { RunThisManyTimes = (CurrentTick - Ball->NextTick); printf("%d\n",RunThisManyTimes); diff --git a/src/enemy.c b/src/enemy.c index 47e2438..56c7d87 100644 --- a/src/enemy.c +++ b/src/enemy.c @@ -3,7 +3,7 @@ void enemy(struct Players *Enemy, struct Balls ball) { int CurrentTick = SDL_AtomicGet(&Ticks); - int RunThisManyTimes; + int RunThisManyTimes = 0; if (Enemy->NextTick <= CurrentTick) { if(CurrentTick > Enemy->NextTick) { RunThisManyTimes = (CurrentTick - Enemy->NextTick); -- cgit 1.4.1-2-gfad0