mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-08 06:06:43 +01:00
fade in/out in intro, and adjustment of pink cloud position on fadein/out menu screen
This commit is contained in:
parent
380595e0ce
commit
70d2697315
2 changed files with 22 additions and 2 deletions
22
intro.c
22
intro.c
|
@ -28,7 +28,15 @@ void Intro_Draw(struct Game *game) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Intro_Load(struct Game *game) {}
|
void Intro_Load(struct Game *game) {
|
||||||
|
ALLEGRO_EVENT ev;
|
||||||
|
for(int fadeloop=0; fadeloop<256; fadeloop+=10){
|
||||||
|
al_wait_for_event(game->event_queue, &ev);
|
||||||
|
al_draw_tinted_bitmap(game->intro.table_bitmap,al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1),0,0,0);
|
||||||
|
DrawConsole(game);
|
||||||
|
al_flip_display();
|
||||||
|
}
|
||||||
|
}
|
||||||
int Intro_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
int Intro_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||||
if (ev->keyboard.keycode == ALLEGRO_KEY_ESCAPE) {
|
if (ev->keyboard.keycode == ALLEGRO_KEY_ESCAPE) {
|
||||||
UnloadGameState(game);
|
UnloadGameState(game);
|
||||||
|
@ -70,6 +78,18 @@ void Intro_Preload(struct Game *game) {
|
||||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||||
}
|
}
|
||||||
void Intro_Unload(struct Game *game) {
|
void Intro_Unload(struct Game *game) {
|
||||||
|
ALLEGRO_EVENT ev;
|
||||||
|
for(int fadeloop=255; fadeloop>=0; fadeloop-=10){
|
||||||
|
al_wait_for_event(game->event_queue, &ev);
|
||||||
|
if (game->intro.in_animation)
|
||||||
|
al_draw_tinted_bitmap(game->intro.table, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), -1*(game->intro.page)*al_get_display_width(game->display) + cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(3.1415/2))*al_get_display_width(game->display), al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
|
||||||
|
else
|
||||||
|
al_draw_tinted_bitmap(game->intro.table, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), -1*(game->intro.page)*al_get_display_width(game->display), al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
|
||||||
|
|
||||||
|
//al_draw_tinted_bitmap(game->intro.table_bitmap,al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1),-1*(game->intro.page)*al_get_display_width(game->display), al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)),0);
|
||||||
|
DrawConsole(game);
|
||||||
|
al_flip_display();
|
||||||
|
}
|
||||||
al_destroy_bitmap(game->intro.table_bitmap);
|
al_destroy_bitmap(game->intro.table_bitmap);
|
||||||
al_destroy_bitmap(game->intro.table);
|
al_destroy_bitmap(game->intro.table);
|
||||||
}
|
}
|
||||||
|
|
2
menu.c
2
menu.c
|
@ -133,7 +133,7 @@ void Menu_Preload(struct Game *game) {
|
||||||
al_destroy_bitmap(game->menu.mountain);
|
al_destroy_bitmap(game->menu.mountain);
|
||||||
|
|
||||||
al_set_target_bitmap(game->menu.menu_fade_bitmap);
|
al_set_target_bitmap(game->menu.menu_fade_bitmap);
|
||||||
al_draw_bitmap(game->menu.pinkcloud_bitmap,(al_get_display_width(game->display)*0.132) + (cos((82)*1.74444))*20, 0,0);
|
al_draw_bitmap(game->menu.pinkcloud_bitmap,(al_get_display_width(game->display)*0.12) + (cos((game->menu.cloud_position/25+80)*1.74444))*40, 0,0);
|
||||||
al_draw_text(game->menu.font_title, al_map_rgb(255,255,255), al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.1, ALLEGRO_ALIGN_CENTRE, "Super Derpy");
|
al_draw_text(game->menu.font_title, al_map_rgb(255,255,255), al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.1, ALLEGRO_ALIGN_CENTRE, "Super Derpy");
|
||||||
al_draw_text(game->menu.font_subtitle, al_map_rgb(255,255,255), al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.275, ALLEGRO_ALIGN_CENTRE, "Muffin Attack");
|
al_draw_text(game->menu.font_subtitle, al_map_rgb(255,255,255), al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.275, ALLEGRO_ALIGN_CENTRE, "Muffin Attack");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue