update map and other graphics

This commit is contained in:
Sebastian Krzyszkowiak 2012-04-30 22:15:11 +02:00
parent 928735faab
commit 1ffe2f8ce5
2 changed files with 19 additions and 11 deletions

View file

@ -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;
};

View file

@ -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);