From 5fb0ae53557d8ffe85b7aae0c32decfba444f2da Mon Sep 17 00:00:00 2001 From: suck5u <suck5u@etu.univ-lorraine.fr> Date: Mon, 28 Dec 2020 18:47:31 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20de=20l'al=C3=A9atoire=20pour=20l'a?= =?UTF-8?q?pparition=20des=20ennemis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/enemy.c | 2 +- code/main.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/enemy.c b/code/enemy.c index 030e773..e777187 100644 --- a/code/enemy.c +++ b/code/enemy.c @@ -10,7 +10,7 @@ void init_enemy(enemy_t *enemy) { - srand(time(NULL)); + int random = rand()%4+0; if (random == 1) { diff --git a/code/main.c b/code/main.c index fe7a801..632e07c 100644 --- a/code/main.c +++ b/code/main.c @@ -23,8 +23,10 @@ int main(void) world_t world; SDL_Window *window; // DĂ©claration de la fenĂȘtre SDL_Renderer *renderer; + srand(time(NULL)); double time; + // Initialisation de la SDL if(SDL_Init(SDL_INIT_VIDEO) < 0) { -- GitLab