00001
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _ALLEGRO5_
00014 #define _ALLEGRO5_
00015 #include <allegro5/allegro5.h>
00016 #endif // _ALLEGRO5_
00017
00018 #ifndef _ALLEGRO5FONT_
00019 #define _ALLEGRO5FONT_
00020 #include <allegro5/allegro_font.h>
00021 #endif // _ALLEGRO5FONT_
00022
00023 #ifndef _ALLEGRO5TTF_
00024 #define _ALLEGRO5TTF_
00025 #include <allegro5/allegro_ttf.h>
00026 #endif // _ALLEGRO5TTF_
00027
00028 #ifndef _ALLEGRO5IMAGE_
00029 #define _ALLEGRO5IMAGE_
00030 #include <allegro5/allegro_image.h>
00031 #endif // _ALLEGRO5IMAGE_
00032
00033 #ifndef _CHIPMUNK_
00034 #define _CHIPMUNK_
00035 #include "chipmunk.h"
00036 #endif // _CHIPMUNK_
00037
00038 #ifndef _COMMONS_
00039 #define _COMMONS_
00040 #include "../include/commons.h"
00041 #endif // _COMMONS_
00042
00043 #ifndef _BUTTONS_
00044 #define _BUTTONS_
00045 #include "../include/buttons.h"
00046 #endif // _BUTTONS_
00047
00048 #ifndef _SPRITES_
00049 #define _SPRITES_
00050 #include "../include/sprites.h"
00051 #endif // _SPRITES_
00052
00053 #ifndef _RENDER_
00054 #define _RENDER_
00055 #include "../include/render.h"
00056 #endif // _RENDER_
00057
00058 #ifndef _MAINGAME_
00059 #define _MAINGAME_
00060 #include "../include/maingame.h"
00061 #endif // _MAINGAME_
00062
00063 #ifndef _GAMEOVER_
00064 #define _GAMEOVER_
00065 #include "../include/gameover.h"
00066 #endif // _GAMEOVER_
00067
00068
00069
00070 static BUTTONPTR quit = NULL;
00071
00072
00073
00074 void gameover(int score, char *survival_time)
00075 {
00076 GDATAPTR game = get_game_data();
00077
00078 if(quit == NULL)
00079 {
00080 quit = create_new_button("QUITTOMENUGO",
00081 "DEFAULT",
00082 "QUIT TO MENU",
00083 game->b_font,
00084 BCOLOR(255, 255, 255, 255),
00085 BCOLOR(65, 105, 255, 191),
00086 -280,
00087 500,
00088 50,
00089 BRIGHT,
00090 BVISIBLE,
00091 true
00092 );
00093 }
00094
00095 al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, RCOLOR(0, 0, 0, 255));
00096 add_element_to_render_queue(NULL, 280, 250, 0, RCOLOR(0, 0, 0, 255), update_score);
00097 add_element_to_render_queue(NULL, 280, 300, 0, RCOLOR(0, 0, 0, 255), update_survivaltime);
00098 al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, RDEFAULT);
00099 }
00100
00101
00102
00103 void gameover_cleanup(void)
00104 {
00105 remove_element_from_button_list(&quit);
00106 quit = NULL;
00107 }
00108
00109
00110
00111 void exit_gameover(GDATAPTR game)
00112 {
00113 BUTTONPTR currentptr, firstptr = get_first_element_from_button_list();
00114 currentptr = search_button_list_for_element(&firstptr, "QUITTOMENU");
00115 currentptr->bdata.limit = 805;
00116 currentptr->bdata.aflags = BRIGHT;
00117 }
00118
00119
00120
00121
00122
00123