From 1ffe2f8ce53f65b946c44b75eff3526a6bf0bf37 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Mon, 30 Apr 2012 22:15:11 +0200 Subject: [PATCH] update map and other graphics --- src/main.h | 12 ++++++++++-- src/map.c | 18 +++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/main.h b/src/main.h index a1e2f63..233244a 100644 --- a/src/main.h +++ b/src/main.h @@ -45,15 +45,22 @@ enum gamestate_enum { struct Moonwalk { ALLEGRO_BITMAP *fade_bitmap; /*!< Bitmap used on fade-in and fade-out animations. */ ALLEGRO_BITMAP *image; /*!< Background texture. */ - int current_level; /*!< Level number. */ int derpy_frame; /*!< Current frame of Derpy animation. */ int derpy_frame_tmp; /*!< Counter used to slow down Derpy animation. */ double derpy_pos; /*!< Position of Derpy on screen. */ }; +struct Obstracle { + ALLEGRO_BITMAP *bitmap; + float x, y, speed; + int points; + void *callback; + struct Obstracle *prev, *next; +}; + /*! \brief Resources used by Level state. */ struct Level { - int current_level; + int current_level; /*!< Level number. */ float speed; float bg_pos, st_pos, fg_pos, cl_pos; float derpy_x, derpy_y; @@ -67,6 +74,7 @@ struct Level { ALLEGRO_BITMAP *welcome; ALLEGRO_BITMAP *derpy_walkcycle; /*!< Derpy walk cycle spritesheet. */ ALLEGRO_BITMAP *derpy; /*!< Derpy sprite. */ + struct Obstracle *obstracles; struct Moonwalk moonwalk; }; diff --git a/src/map.c b/src/map.c index de28bd3..84c6639 100644 --- a/src/map.c +++ b/src/map.c @@ -28,28 +28,28 @@ void Map_Draw(struct Game *game) { float x,y; switch (game->map.selected) { case 1: - x=0.18; - y=0.225; + x=0.2; + y=0.25; break; case 2: x=0.5; - y=0.3125; + y=0.375; break; case 3: x=0.738; - y=0.425; + y=0.4; break; case 4: - x=0.61; + x=0.7; y=0.7625; break; case 5: - x=0.17; - y=0.725; + x=0.225; + y=0.75; break; case 6: - x=0.41; - y=0.518; + x=0.425; + y=0.65; break; } al_draw_scaled_bitmap(game->map.arrow, 0, 0, al_get_bitmap_width(game->map.arrow), al_get_bitmap_height(game->map.arrow), al_get_display_width(game->display)*x, al_get_display_height(game->display)*y + ((sin(game->map.arrowpos)+0.5)/20.0)*al_get_display_height(game->display), al_get_display_width(game->display)*0.1, al_get_display_height(game->display)*0.16, 0);