mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 11:06:44 +01:00
implement owl :D
This commit is contained in:
parent
836eaedc41
commit
cd65b1d8e5
2 changed files with 24 additions and 2 deletions
25
src/level.c
25
src/level.c
|
@ -183,7 +183,7 @@ void Level_Draw(struct Game *game) {
|
||||||
TM_AddBackgroundAction(&LevelFailed, NULL, 0, "levelfailed");
|
TM_AddBackgroundAction(&LevelFailed, NULL, 0, "levelfailed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tmp->x -= tps(game, game->level.speed*game->level.speed_modifier*60*tmp->speed)*310;
|
tmp->x -= tps(game, game->level.speed*game->level.speed_modifier*60*tmp->speed)*100*al_get_bitmap_width(game->level.stage)/(float)al_get_display_width(game->display);
|
||||||
if (tmp->callback) tmp->callback(game, tmp);
|
if (tmp->callback) tmp->callback(game, tmp);
|
||||||
tmp = tmp->next;
|
tmp = tmp->next;
|
||||||
} else {
|
} else {
|
||||||
|
@ -310,6 +310,25 @@ void Level_Load(struct Game *game) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
TM_AddAction(&PassLevel, NULL, "passlevel");
|
TM_AddAction(&PassLevel, NULL, "passlevel");
|
||||||
|
|
||||||
|
struct Obstacle *obst = malloc(sizeof(struct Obstacle));
|
||||||
|
obst->prev = NULL;
|
||||||
|
obst->next = NULL;
|
||||||
|
obst->x = 83.5;
|
||||||
|
obst->y = 55;
|
||||||
|
obst->speed = 1;
|
||||||
|
obst->points = 0;
|
||||||
|
obst->hit = false;
|
||||||
|
obst->rows = 1;
|
||||||
|
obst->cols = 1;
|
||||||
|
obst->pos = 0;
|
||||||
|
obst->blanks = 0;
|
||||||
|
obst->anim_speed = 0;
|
||||||
|
obst->tmp_pos = 0;
|
||||||
|
obst->callback = NULL;
|
||||||
|
obst->data = NULL;
|
||||||
|
obst->bitmap = &(game->level.owl);
|
||||||
|
game->level.obstacles = obst;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,7 +452,7 @@ void Level_UnloadBitmaps(struct Game *game) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Level_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
void Level_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||||
PROGRESS_INIT(12);
|
PROGRESS_INIT(13);
|
||||||
int x = 0;
|
int x = 0;
|
||||||
struct Spritesheet *tmp = game->level.derpy_sheets;
|
struct Spritesheet *tmp = game->level.derpy_sheets;
|
||||||
while (tmp) {
|
while (tmp) {
|
||||||
|
@ -473,6 +492,8 @@ void Level_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, floa
|
||||||
PROGRESS;
|
PROGRESS;
|
||||||
game->level.obst_bmps.muffin = LoadScaledBitmap("levels/muffin.png", al_get_display_width(game->display)*0.07, al_get_display_height(game->display)*0.1);
|
game->level.obst_bmps.muffin = LoadScaledBitmap("levels/muffin.png", al_get_display_width(game->display)*0.07, al_get_display_height(game->display)*0.1);
|
||||||
PROGRESS;
|
PROGRESS;
|
||||||
|
game->level.owl = LoadScaledBitmap("levels/owl.png", al_get_display_width(game->display)*0.08, al_get_display_width(game->display)*0.08);
|
||||||
|
PROGRESS;
|
||||||
game->level.welcome = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display)/2);
|
game->level.welcome = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display)/2);
|
||||||
PROGRESS;
|
PROGRESS;
|
||||||
al_set_target_bitmap(game->level.welcome);
|
al_set_target_bitmap(game->level.welcome);
|
||||||
|
|
|
@ -121,6 +121,7 @@ struct Level {
|
||||||
ALLEGRO_SAMPLE *sample; /*!< Sample with background music. */
|
ALLEGRO_SAMPLE *sample; /*!< Sample with background music. */
|
||||||
ALLEGRO_SAMPLE_INSTANCE *music; /*!< Sample instance with background music. */
|
ALLEGRO_SAMPLE_INSTANCE *music; /*!< Sample instance with background music. */
|
||||||
unsigned int music_pos; /*!< Position of sample instance. Used when pausing game. */
|
unsigned int music_pos; /*!< Position of sample instance. Used when pausing game. */
|
||||||
|
ALLEGRO_BITMAP *owl; /*!< Owlicious bitmap. */
|
||||||
ALLEGRO_BITMAP *background; /*!< Bitmap of the background layer of the scene. */
|
ALLEGRO_BITMAP *background; /*!< Bitmap of the background layer of the scene. */
|
||||||
ALLEGRO_BITMAP *stage; /*!< Bitmap of the stage layer of the scene. */
|
ALLEGRO_BITMAP *stage; /*!< Bitmap of the stage layer of the scene. */
|
||||||
ALLEGRO_BITMAP *foreground; /*!< Bitmap of the foreground layer of the scene. */
|
ALLEGRO_BITMAP *foreground; /*!< Bitmap of the foreground layer of the scene. */
|
||||||
|
|
Loading…
Reference in a new issue