From 60a398408a2b5cd3a84f6b627a9568533cbf1158 Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 13 Feb 2016 16:59:00 +0000 Subject: [PATCH] Updated random planet placement. --- src/galaxy/mission.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index 4f88781..705c35c 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -48,8 +48,8 @@ void loadMission(char *filename) battle.background = getTexture(cJSON_GetObjectItem(root, "background")->valuestring); battle.planetTexture = getTexture(cJSON_GetObjectItem(root, "planet")->valuestring); - battle.planet.x = ((200 + rand() % 100) / 10) * GRID_CELL_WIDTH; - battle.planet.y = ((200 + rand() % 100) / 10) * GRID_CELL_HEIGHT; + battle.planet.x = (SCREEN_WIDTH / 2) - (rand() % SCREEN_WIDTH) + (rand() % SCREEN_WIDTH); + battle.planet.y = (SCREEN_HEIGHT / 2) - (rand() % SCREEN_HEIGHT) + (rand() % SCREEN_HEIGHT); loadObjectives(cJSON_GetObjectItem(root, "objectives"));