diff --git a/src/challenges/challengeHome.c b/src/challenges/challengeHome.c index ad7426a..ab33b50 100644 --- a/src/challenges/challengeHome.c +++ b/src/challenges/challengeHome.c @@ -39,6 +39,8 @@ static SDL_Texture *background; static int startIndex; static Widget *start; static int completedChallenges; +static SDL_Texture *planetTexture; +static PointF planet; static int totalChallenges; static int show; @@ -58,10 +60,14 @@ void initChallengeHome(void) app.delegate.draw = &draw; memset(&app.keyboard, 0, sizeof(int) * MAX_KEYBOARD_KEYS); - background = getTexture("gfx/backgrounds/background04.jpg"); + background = getTexture("gfx/backgrounds/background06.jpg"); + planetTexture = getTexture("gfx/planets/bluePlanet.png"); battle.camera.x = battle.camera.y = 0; + planet.x = SCREEN_WIDTH; + planet.y = (rand() % SCREEN_HEIGHT - 128); + game.currentMission = NULL; startIndex = 0; @@ -112,6 +118,13 @@ static void logic(void) doStars(0.5, 0); + planet.x -= 0.25; + if (planet.x <= -200) + { + planet.x = SCREEN_WIDTH + (rand() % SCREEN_WIDTH); + planet.y = (rand() % SCREEN_HEIGHT - 128); + } + switch (show) { case SHOW_CHALLENGES: @@ -161,6 +174,8 @@ static void draw(void) { drawBackground(background); + blit(planetTexture, planet.x, planet.y, 0); + drawStars(); drawText(SCREEN_WIDTH / 2, 50, 30, TA_CENTER, colors.white, _("Challenges")); diff --git a/src/challenges/challengeHome.h b/src/challenges/challengeHome.h index d776c9a..3d23165 100644 --- a/src/challenges/challengeHome.h +++ b/src/challenges/challengeHome.h @@ -54,6 +54,7 @@ extern void playSound(int sound); extern void selectWidget(const char *name, const char *group); extern void updateAllMissions(void); extern char *getTranslatedString(char *string); +extern void blit(SDL_Texture *t, int x, int y, int centered); extern App app; extern Battle battle;