summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hdaps-tux.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hdaps-tux.c b/hdaps-tux.c
index 38ddf1a..1856040 100644
--- a/hdaps-tux.c
+++ b/hdaps-tux.c
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
SDL_Rect dst, dstwhite;
SDL_Event event;
Uint8 *keys;
- int tuxX = 180, tuxY = 170;
+ int tuxX = 0, tuxY = 0;
int hdapsX = 0, hdapsY = 0;
int hdapsXprev = 0, hdapsYprev = 0;
int vel = 4;
@@ -98,6 +98,10 @@ int main(int argc, char *argv[])
dstwhite.h = image->h + 1;
SDL_SetColorKey(image, SDL_SRCCOLORKEY, SDL_MapRGB(image->format, 255, 255, 255));
+ /* Calculate and set initial position of tux (centre of the window) */
+ tuxX = (W_WIDTH / 2) - (image->w / 2);
+ tuxY = (W_HEIGHT / 2) - (image->h / 2);
+
/* Get the hdaps position so we have something to start from */
get_pos(&hdapsX, &hdapsY);