mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-01 11:06:44 +01:00
lots of cosmetic things
This commit is contained in:
parent
49229e3658
commit
06689721f0
6 changed files with 45 additions and 21 deletions
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by Qt Creator 2.5.81, 2012-05-18T18:30:51. -->
|
||||
<!-- Written by Qt Creator 2.5.81, 2012-05-22T17:27:41. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>GenericProjectManager.GenericProject.Toolchain</variable>
|
||||
|
|
32
src/about.c
32
src/about.c
|
@ -36,10 +36,13 @@ void About_Draw(struct Game *game) {
|
|||
}
|
||||
|
||||
al_draw_scaled_bitmap(game->about.image,0,0,al_get_bitmap_width(game->about.image),al_get_bitmap_height(game->about.image),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0);
|
||||
al_draw_scaled_bitmap(game->about.letter,0,0,al_get_bitmap_width(game->about.letter),al_get_bitmap_height(game->about.letter),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0);
|
||||
al_draw_bitmap(game->about.letter, al_get_display_width(game->display)*0.3, -al_get_display_height(game->display)*0.1, 0);
|
||||
float x = game->about.x;
|
||||
if (x<0) x=0;
|
||||
al_draw_bitmap_region(game->about.text_bitmap, 0, x*al_get_bitmap_height(game->about.text_bitmap), al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8, al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.1, 0);
|
||||
ALLEGRO_BITMAP* subbitmap;
|
||||
subbitmap = al_create_sub_bitmap(game->about.text_bitmap, 0, x*al_get_bitmap_height(game->about.text_bitmap), al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8);
|
||||
al_draw_rotated_bitmap(subbitmap, al_get_bitmap_width(subbitmap)/2.0, al_get_bitmap_height(subbitmap)/2.0, al_get_display_width(game->display)*0.5+al_get_bitmap_width(subbitmap)/2.0, al_get_display_height(game->display)*0.1+al_get_bitmap_height(subbitmap)/2.0, -0.1, 0);
|
||||
al_destroy_bitmap(subbitmap);
|
||||
game->about.x+=tps(game, 60*0.00025);
|
||||
if (game->about.x>1) {
|
||||
UnloadGameState(game);
|
||||
|
@ -68,7 +71,7 @@ void About_Preload(struct Game *game, void (*progress)(struct Game*, float)) {
|
|||
|
||||
game->about.image =LoadScaledBitmap("table.png", al_get_display_width(game->display), al_get_display_height(game->display));
|
||||
PROGRESS;
|
||||
game->about.letter = LoadScaledBitmap("about/letter.png", al_get_display_width(game->display), al_get_display_height(game->display) );
|
||||
game->about.letter = LoadScaledBitmap("about/letter.png", al_get_display_height(game->display)*1.3, al_get_display_height(game->display)*1.3 );
|
||||
PROGRESS;
|
||||
|
||||
game->about.sample = al_load_sample( "data/about/about.flac" );
|
||||
|
@ -89,12 +92,12 @@ void About_Preload(struct Game *game, void (*progress)(struct Game*, float)) {
|
|||
game->about.text_bitmap = al_create_bitmap(al_get_display_width(game->display)*0.4, al_get_display_height(game->display)*3.5);
|
||||
al_set_target_bitmap(game->about.text_bitmap);
|
||||
al_clear_to_color(al_map_rgba(0,0,0,0));
|
||||
al_draw_text(game->about.font, al_map_rgb(255,255,255), 0.5*al_get_bitmap_width(game->about.text_bitmap), 0.015*al_get_bitmap_height(game->about.text_bitmap), ALLEGRO_ALIGN_CENTRE, "Super Derpy: Muffin Attack");
|
||||
al_draw_text(game->about.font, al_map_rgb(255,255,255), 0.5*al_get_bitmap_width(game->about.text_bitmap), 0.035*al_get_bitmap_height(game->about.text_bitmap), ALLEGRO_ALIGN_CENTRE, "Version 0.1");
|
||||
al_draw_text(game->about.font, al_map_rgb(0,0,0), 0.5*al_get_bitmap_width(game->about.text_bitmap), 0.015*al_get_bitmap_height(game->about.text_bitmap), ALLEGRO_ALIGN_CENTRE, "Super Derpy: Muffin Attack");
|
||||
al_draw_text(game->about.font, al_map_rgb(0,0,0), 0.5*al_get_bitmap_width(game->about.text_bitmap), 0.035*al_get_bitmap_height(game->about.text_bitmap), ALLEGRO_ALIGN_CENTRE, "Version 0.1");
|
||||
|
||||
float y=0.07;
|
||||
void draw_text(char* text) {
|
||||
al_draw_text(game->about.font, al_map_rgb(255,255,255), 0, y*al_get_bitmap_height(game->about.text_bitmap), ALLEGRO_ALIGN_LEFT, text);
|
||||
al_draw_text(game->about.font, al_map_rgb(0,0,0), 0, y*al_get_bitmap_height(game->about.text_bitmap), ALLEGRO_ALIGN_LEFT, text);
|
||||
y+=0.0128;
|
||||
}
|
||||
|
||||
|
@ -175,8 +178,11 @@ void About_Preload(struct Game *game, void (*progress)(struct Game*, float)) {
|
|||
|
||||
al_set_target_bitmap(game->about.fade_bitmap);
|
||||
al_draw_bitmap(game->about.image, 0, 0, 0);
|
||||
al_draw_bitmap(game->about.letter, 0, 0, 0);
|
||||
al_draw_bitmap_region(game->about.text_bitmap, 0, 0, al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8, al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.1, 0);
|
||||
al_draw_bitmap(game->about.letter, al_get_display_width(game->display)*0.3, -al_get_display_height(game->display)*0.1, 0);
|
||||
ALLEGRO_BITMAP* subbitmap;
|
||||
subbitmap = al_create_sub_bitmap(game->about.text_bitmap, 0, 0, al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8);
|
||||
al_draw_rotated_bitmap(subbitmap, al_get_bitmap_width(subbitmap)/2.0, al_get_bitmap_height(subbitmap)/2.0, al_get_display_width(game->display)*0.5+al_get_bitmap_width(subbitmap)/2.0, al_get_display_height(game->display)*0.1+al_get_bitmap_height(subbitmap)/2.0, -0.1, 0);
|
||||
al_destroy_bitmap(subbitmap);
|
||||
|
||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||
PROGRESS;
|
||||
|
@ -187,9 +193,13 @@ void About_Unload(struct Game *game) {
|
|||
ALLEGRO_EVENT ev;
|
||||
game->about.fade_bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display));
|
||||
al_set_target_bitmap(game->about.fade_bitmap);
|
||||
al_draw_scaled_bitmap(game->about.image,0,0,al_get_bitmap_width(game->about.image),al_get_bitmap_height(game->about.image),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0);
|
||||
al_draw_scaled_bitmap(game->about.letter,0,0,al_get_bitmap_width(game->about.letter),al_get_bitmap_height(game->about.letter),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0);
|
||||
al_draw_bitmap_region(game->about.text_bitmap, 0, game->about.x*al_get_bitmap_height(game->about.text_bitmap), al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8, al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.1, 0);
|
||||
al_draw_bitmap(game->about.image,0,0,0);
|
||||
al_draw_bitmap(game->about.letter, al_get_display_width(game->display)*0.3, -al_get_display_height(game->display)*0.1, 0);
|
||||
|
||||
ALLEGRO_BITMAP* subbitmap;
|
||||
subbitmap = al_create_sub_bitmap(game->about.text_bitmap, 0, game->about.x*al_get_bitmap_height(game->about.text_bitmap), al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8);
|
||||
al_draw_rotated_bitmap(subbitmap, al_get_bitmap_width(subbitmap)/2.0, al_get_bitmap_height(subbitmap)/2.0, al_get_display_width(game->display)*0.5+al_get_bitmap_width(subbitmap)/2.0, al_get_display_height(game->display)*0.1+al_get_bitmap_height(subbitmap)/2.0, -0.1, 0);
|
||||
al_destroy_bitmap(subbitmap);
|
||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||
float fadeloop;
|
||||
if (game->about.fadeloop!=0)
|
||||
|
|
17
src/level.c
17
src/level.c
|
@ -442,7 +442,14 @@ void Level_UnloadBitmaps(struct Game *game) {
|
|||
al_destroy_bitmap(game->level.stage);
|
||||
al_destroy_bitmap(game->level.clouds);
|
||||
al_destroy_bitmap(game->level.welcome);
|
||||
al_destroy_bitmap(game->level.obst_bmps.pie);
|
||||
al_destroy_bitmap(game->level.letter);
|
||||
al_destroy_bitmap(game->level.owl);
|
||||
al_destroy_bitmap(game->level.obst_bmps.pie1);
|
||||
al_destroy_bitmap(game->level.obst_bmps.pie2);
|
||||
al_destroy_bitmap(game->level.obst_bmps.pig);
|
||||
al_destroy_bitmap(game->level.obst_bmps.muffin);
|
||||
al_destroy_bitmap(game->level.obst_bmps.badmuffin);
|
||||
al_destroy_bitmap(game->level.obst_bmps.screwball);
|
||||
al_destroy_bitmap(game->level.meter_bmp);
|
||||
al_destroy_bitmap(game->level.meter_image);
|
||||
}
|
||||
|
@ -483,7 +490,9 @@ void Level_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, floa
|
|||
PROGRESS;
|
||||
game->level.stage = LoadScaledBitmap("levels/1/stage.png", al_get_display_height(game->display)*4.73307291666666666667, al_get_display_height(game->display));
|
||||
PROGRESS;
|
||||
game->level.obst_bmps.pie = LoadScaledBitmap("menu/pie.png", al_get_display_width(game->display)*0.1, al_get_display_height(game->display)*0.1);
|
||||
game->level.obst_bmps.pie1 = LoadScaledBitmap("levels/pie1.png", al_get_display_width(game->display)*0.1, al_get_display_height(game->display)*0.08);
|
||||
PROGRESS;
|
||||
game->level.obst_bmps.pie2 = LoadScaledBitmap("levels/pie2.png", al_get_display_width(game->display)*0.1, al_get_display_height(game->display)*0.08);
|
||||
PROGRESS;
|
||||
game->level.obst_bmps.pig = LoadScaledBitmap("levels/pig.png", (int)(al_get_display_width(game->display)*0.15)*3, (int)(al_get_display_height(game->display)*0.2)*3);
|
||||
PROGRESS;
|
||||
|
@ -495,9 +504,9 @@ void Level_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, floa
|
|||
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.letter = LoadScaledBitmap("levels/letter.png", al_get_display_width(game->display), al_get_display_height(game->display));
|
||||
game->level.letter = LoadScaledBitmap("levels/letter.png", al_get_display_height(game->display), al_get_display_height(game->display));
|
||||
al_set_target_bitmap(game->level.letter);
|
||||
al_draw_text(game->menu.font_subtitle, al_map_rgb(0,0,0), al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.45, ALLEGRO_ALIGN_CENTRE, "Letter from Twilight");
|
||||
al_draw_text(game->menu.font, al_map_rgb(0,0,0), al_get_bitmap_width(game->level.letter)*0.375, al_get_display_height(game->display)*0.45, ALLEGRO_ALIGN_CENTRE, "Letter from Twilight");
|
||||
al_set_target_bitmap(al_get_backbuffer(game->display));
|
||||
PROGRESS;
|
||||
game->level.welcome = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display)/2);
|
||||
|
|
|
@ -144,8 +144,12 @@ bool GenerateObstacles(struct Game *game, struct TM_Action *action, enum TM_Acti
|
|||
obst->bitmap = &(game->level.obst_bmps.muffin);
|
||||
} else if (rand()%100<=65) {
|
||||
obst->callback= &Obst_MoveUp;
|
||||
obst->bitmap = &(game->level.obst_bmps.pie);
|
||||
obst->data = malloc(sizeof(float));
|
||||
if (rand()%100<=80) obst->bitmap = &(game->level.obst_bmps.pie1);
|
||||
else {
|
||||
obst->bitmap = &(game->level.obst_bmps.pie2);
|
||||
obst->points = -12;
|
||||
}
|
||||
obst->data = malloc(sizeof(float));
|
||||
*((float*)obst->data) = 0.25+(rand()%50/100.0);
|
||||
obst->y*=1.8;
|
||||
obst->angle = ((rand()%50)/100.0)-0.25;
|
||||
|
@ -204,7 +208,7 @@ bool Letter(struct Game *game, struct TM_Action *action, enum TM_ActionState sta
|
|||
float* f = (float*)action->arguments->value;
|
||||
*f+=tps(game,350);
|
||||
if (*f>255) *f=255;
|
||||
al_draw_tinted_bitmap(game->level.letter, al_map_rgba(*f,*f,*f,*f), 0, 0, 0);
|
||||
al_draw_tinted_bitmap(game->level.letter, al_map_rgba(*f,*f,*f,*f), (al_get_display_width(game->display)-al_get_bitmap_width(game->level.letter))/2.0, 0, 0);
|
||||
struct ALLEGRO_KEYBOARD_STATE keyboard;
|
||||
al_get_keyboard_state(&keyboard);
|
||||
if (al_key_down(&keyboard, ALLEGRO_KEY_ENTER)) {
|
||||
|
|
|
@ -137,7 +137,8 @@ struct Level {
|
|||
struct Spritesheet* derpy_sheets; /*!< List of sprite sheets of Derpy character. */
|
||||
struct Spritesheet* pony_sheets; /*!< List of sprite sheets of character rescued by Derpy. */
|
||||
struct {
|
||||
ALLEGRO_BITMAP *pie; /*!< Pie bitmap. */
|
||||
ALLEGRO_BITMAP *pie1; /*!< Pie bitmap. */
|
||||
ALLEGRO_BITMAP *pie2; /*!< Pie bitmap (crossed). */
|
||||
ALLEGRO_BITMAP *muffin; /*!< Good muffin bitmap. */
|
||||
ALLEGRO_BITMAP *badmuffin; /*!< Bad muffin bitmap. */
|
||||
ALLEGRO_BITMAP *pig; /*!< Pig spritesheet bitmap. */
|
||||
|
|
|
@ -163,7 +163,7 @@ void Menu_Preload(struct Game *game, void (*progress)(struct Game*, float)) {
|
|||
al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP);
|
||||
game->menu.rain = al_load_bitmap( "data/menu/rain.png" );
|
||||
PROGRESS;
|
||||
game->menu.pie = al_load_bitmap( "data/menu/pie.png" );
|
||||
game->menu.pie = al_load_bitmap( "data/levels/pie1.png" );
|
||||
al_set_new_bitmap_flags(ALLEGRO_MAG_LINEAR | ALLEGRO_MIN_LINEAR);
|
||||
PROGRESS;
|
||||
|
||||
|
|
Loading…
Reference in a new issue