From: parking_turkeys Date: Sat, 25 Jul 2026 21:37:35 +0000 (-0400) Subject: start work on ending X-Git-Tag: v1.0~9 X-Git-Url: http://git.parking-turkeys.net/?a=commitdiff_plain;h=bbe131890c3d84b659e04085ec64d2dcea92cfc3;p=aichan-platformer.git start work on ending --- diff --git a/bossfight.c b/bossfight.c new file mode 100644 index 0000000..affaa75 --- /dev/null +++ b/bossfight.c @@ -0,0 +1,82 @@ +#include "game.h" +#include "raylib.h" +#include + +#define DLGCOUNT 15 +//really shouldnt do this all in here but idc + +static struct dialogue dialogues[DLGCOUNT] = { + {"It's time to have an epic idol fight!!", "Rozaliya", "dialogue-img/aichan-default.png", PINK}, + {"Roza... is this really a good idea?", "Liliya", "dialogue-img/aichan-default.png", BLUE}, + {"(Liliya!! Stop it!)\nAnyway, we're totally going to win and stuff!!", "Rozaliza", "dialogue-img/aichan-default.png", PINK}, + {"No way!! WE'RE going to win!!", "Ai-chan", "dialogue-img/aichan-angry.png", GREEN}, + {"I can't even take this anymore. the dialogue. is too bad.", "Context", "dialogue-img/context.png", BLACK}, + {"Who are you?", "olenyevas", "dialogue-img/aichan-default.png", PURPLE}, + {"I'm...\ngoing to beat all of you in a fight.", "context [?]", "dialogue-img/context.png", BLACK}, + {"FUCK YOU!! WERE ALL GOING TO BEAT YOU", "Ai-chan", "dialogue-img/aichan-angry.png", GREEN}, + {"Please just stop talking", "evil context??", "dialogue-img/context.png", BLACK}, + + + {"well you won i guess", "???", "dialogue-img/context.png", BLACK}, + {"Who are you?? and WHY did you interrupt our super epic awesome idol fight??", "Rozaliya", "dialogue-img/aichan-default.png", PINK}, + {"I'm the will of Honkai", "tWoH?????", "dialogue-img/context.png", BLACK}, + {"WHAT??? NOOOOOOOO", "Rozaliya", "dialogue-img/aichan-default.png", PINK}, + {"...PROMETHEUS?", "Liliya", "dialogue-img/aichan-default.png", BLUE}, + {"Actually, it's PROMETHEUS no.17.", "PROMETHEUS", "dialogue-img/aichan-default.png",GRAY} +}; + +int current_dlg = 0; + +struct dialogue *pre_dialogue = dialogues; +int pre_dialogue_count = 9; + +struct dialogue *post_dialogue_win = dialogues+9; +int post_dialogue_win_count = 2; + +int prome_hp = 262144; //2^18 +int player_hp = 524288; //2^19 + +int player_atk = 64; //may seem little but. the whole point is to spam. also itll go up later +int brick_atk = 1024; +int prome_atk = 256; +int prome_atk_time = 0.2; + + + +int update_boss_screen(float delta) +{ + switch (frozen) { + case 0: + //normal gameplay + break; + default: + //nothing? + break; + }; + return 1; +}; + +int draw_boss_screen(void) +{ + switch (frozen) { + case 1: //pre-fight dialogue + drawdialogue(pre_dialogue+current_dlg); + if (IsKeyPressed(inputs[5])) { + if (++current_dlg >= pre_dialogue_count) { //dialogue over + current_dlg = 0; + frozen = 0; + }; + }; + break; + case 0: + //fight + break; + case 2: + //post-fight-win dialogue + break; + case 3: + //post-fight-lose dialogue + break; + }; + return 1; +}; diff --git a/game.h b/game.h index 3110af7..c39054f 100644 --- a/game.h +++ b/game.h @@ -21,33 +21,8 @@ #define STARTGAMEMODE 0 #define LEVELMODE 1 -#define ENDSCREENMODE 2 - -struct character *spielersetup(void); -int next_level(struct character *player); -int kill_chara(struct character *player); -int interact(struct Rectangle *rect); - -int bühnezeichnen(void); //i dont think stage works here but it seems better than window -int spielerzeichnen(void); - -int variables(float delta, struct character *player); -int spieler_bewegen(float delta); -int physics(float delta, struct character *player); - - - -int on_floor(struct Rectangle *rect); -int in_floor(struct Rectangle *rect); -int sliding_wall(struct Rectangle *rect); -int is_killed(struct Rectangle *rect); - -int level_cleanup(void); -int player_cleanup(void); - -int drawstartgame(void); -int handlebuttons(void); -int drawendscreen(int game_seconds); +#define BOSSFIGHTMODE 2 +#define ENDSCREENMODE 3 //structures struct character { @@ -105,6 +80,38 @@ struct spritesheet { int columns; }; +//functions +struct character *spielersetup(void); +int next_level(struct character *player); +int kill_chara(struct character *player); +int interact(struct Rectangle *rect); + +int bühnezeichnen(void); //i dont think stage works here but it seems better than window +int spielerzeichnen(void); + +int variables(float delta, struct character *player); +int spieler_bewegen(float delta); +int physics(float delta, struct character *player); + + + +int on_floor(struct Rectangle *rect); +int in_floor(struct Rectangle *rect); +int sliding_wall(struct Rectangle *rect); +int is_killed(struct Rectangle *rect); + +int level_cleanup(void); +int player_cleanup(void); + +int drawstartgame(void); +int handlebuttons(void); +int drawendscreen(int game_seconds); + +int drawdialogue(struct dialogue *dialogueline); + +int update_boss_screen(float delta); +int draw_boss_screen(void); + //variables extern int level; diff --git a/level.c b/level.c index 1776024..47b5b15 100644 --- a/level.c +++ b/level.c @@ -11,7 +11,7 @@ #define DLGHEIGHT 180 #define CHARADISPLAYWIDTH 140 #define DLGPADDING 5 -#define CHARANAMETEXTSIZE 30 +#define CHARANAMETEXTSIZE 25 #define DLGTEXTWIDTH SCREENWIDTH - DLGPADDING * 2 - CHARADISPLAYWIDTH #define COINPADDING 5 @@ -22,7 +22,6 @@ int COIN_COUNT = COINCOUNT; int current_dialogue = 0; -int drawdialogue(struct dialogue *dialogue); int drawcharname(char *name, Color colour); int drawcharimage(char *filename); int drawdialogueline(char *line); @@ -183,7 +182,7 @@ int drawdialogue(struct dialogue *dlg) int drawcharname(char *name, Color colour) { - DrawText(name,DLGPADDING,DLGY + DLGPADDING,CHARANAMETEXTSIZE,colour); + DrawText(name,DLGPADDING,DLGY + DLGPADDING + (30 - CHARANAMETEXTSIZE) ,CHARANAMETEXTSIZE,colour); return 1; } diff --git a/main_v2.c b/main_v2.c index dad3c74..62cf085 100644 --- a/main_v2.c +++ b/main_v2.c @@ -11,8 +11,8 @@ #include // seems useful int level = 0; -int frozen = 0; //0:game, 1:stage dialogue, 2+:object[frozen-2] dialogue -int mode = 0; //0:'start game', 1: 'levels', 2:'end screen' (later: 2 will be bossfight and 3 will be end screen lol) +int frozen = 1; //0:game, 1:stage dialogue, 2+:object[frozen-2] dialogue || 0:fight 1:pre-fight dialogue +int mode = 2; //0:'start game', 1: 'levels', 2:'end screen' (later: 2 will be bossfight and 3 will be end screen lol) int fullsectime = 0; int deaths = 0; int drawhitboxes = 0; @@ -50,6 +50,13 @@ int main(void) ZeichnenAufhören(); }; break; + case BOSSFIGHTMODE: + update_boss_screen(GetFrameTime()); + ZeichnenAnfangen(); + ClearBackground(RAYWHITE); + draw_boss_screen(); + ZeichnenAufhören(); + break; case ENDSCREENMODE: //printf("enddd"); ZeichnenAnfangen();