From: parking_turkeys Date: Mon, 27 Jul 2026 01:49:18 +0000 (-0400) Subject: more art. but also the weirdest bug ever?? wtf?? X-Git-Tag: v1.0~4 X-Git-Url: http://git.p-t.hackclub.app/?a=commitdiff_plain;h=edb9453876e7d5418067720459991e399228a398;p=aichan-platformer.git more art. but also the weirdest bug ever?? wtf?? --- diff --git a/bossfight.c b/bossfight.c index 56092e2..5f1c62d 100644 --- a/bossfight.c +++ b/bossfight.c @@ -7,11 +7,11 @@ #define PROMEMAXHP 262144 #define PLAYERMAXHP 524288 -char *PROMEIMGPATH = "dialogue-img/aichan-default.png"; //REPLACE LATER!! +char *PROMEIMGPATH = "img/context_fight/normal.png"; #define BRICKCOOLDOWNFULL 5 #define SKILLCOUNT 2 #define ENEMYSKILLCOUNT 1 -char *DEFAULTANIMFRAME = "dialogue-img/aichan-default.png"; //REPLACE LATER--this is the default image in the animation window, should be Ai holding the banhammer +char *DEFAULTANIMFRAME = "img/defaultatk/default.png"; #define PLAYERIMGWIDTH 320 #define PLAYERIMGHEIGHT 240 @@ -72,12 +72,12 @@ struct enemy_attack { //really shouldnt do this all in here but idc static struct sp_attack skills[SKILLCOUNT] = { - { KEY_H, "H", "dialogue-img/aichan-default.png", "dialogue-img/aichan-default.png", 1, 0.0333, 256, 0, 0, 1}, - { KEY_ONE, "1", "img/brick.png", "img/brickatk/sheet.png", 3, 0.2, 1024,0,5,ENABLE_BRICK_DEFAULT}, + { KEY_H, "H", "img/defaultatk/icon.png", "img/defaultatk/sheet.png", 1, 0.0333, 256, 0, 0, 1}, + { KEY_ONE, "1", "img/brick.png", "img/brickatk/sheet.png", 3, 0.0666, 4096,0,5,ENABLE_BRICK_DEFAULT}, }; static struct enemy_attack enemy_skills[ENEMYSKILLCOUNT] = { - { "dialogue-img/aichan-default.png", "attack!", 512, 0, 0.2, 1, 0.1} + { "img/context_fight/attack.png", "attack!", 512, 0, 0.2, 1, 0.1} }; @@ -134,10 +134,15 @@ int update_boss_screen(float delta) switch (frozen) { case 0: update_cooldowns(delta); + //printf("cooldowns updated!\n"); curr_player_attack = get_player_attack(); + //printf("player attack handled!\n"); curr_enemy_attack = get_enemy_attack(); + //printf("enemy attack handled!\n"); update_player_texture(); + //printf("player textures handled!\n"); update_enemy_texture(); + //printf("enemy textures handled!\n"); if (prome_hp <= 0) { frozen = 2; @@ -250,7 +255,7 @@ static int get_player_attack(void) int k; while ((k = GetKeyPressed()) != 0) { for (int i = 0; i < SKILLCOUNT; i++) { - if ((skills[i].enabled) && (k == skills[i].keybind) && (skills[i].cooldown_left <= 0)) { + if ((skills[i].enabled) && (k == skills[i].keybind) && (skills[i].cooldown_left <= 0) && (curr_player_attack < 1)) { //new attack so reset all of the animation and stuff player_img_time_shown = 0; player_img_frame = 0; @@ -314,32 +319,35 @@ int draw_boss_screen(void) static int draw_hp_bar(int hp, int max_hp, Vector2 position); static int draw_enemy_img(void); static int draw_player_img(void); -static int draw_attacks(struct sp_attack (*attack)[SKILLCOUNT]); +static int draw_attacks(struct sp_attack **attacks); static int draw_fight_screen(void) { //so like draw the enemy display for a bit DrawText("\"Context\"??:", 80,45,30,BLACK); //enemy name :) - draw_hp_bar(prome_hp,PROMEMAXHP, (Vector2){300,40}); + draw_hp_bar(prome_hp,PROMEMAXHP, (Vector2){300,40}); draw_enemy_img(); - + //printf("enemy display DRAWN!\n"); //draw the player display next!! draw_hp_bar(player_hp,PLAYERMAXHP,(Vector2){320,420}); draw_player_img(); - draw_attacks(&skills); + //printf("player display DRAWN!\n"); + struct sp_attack *a = &(skills[0]); + draw_attacks(&a); + //printf("attack display DRAWN!\n"); return 1; }; static int draw_sp_attack(struct sp_attack *attack, Vector2 position); -static int draw_attacks(struct sp_attack (*a)[SKILLCOUNT]) +static int draw_attacks(struct sp_attack **a) { Vector2 position = {ATKDISPLAYX, ATKDISPLAYY}; for (int i = 0; i < SKILLCOUNT; i++) { - if ((*a)[i].enabled) { + if ((*a+i)->enabled == 1) { - draw_sp_attack((*a)+i, position); + draw_sp_attack(((*a)+i), position); position.x += ATKDISPLAYWIDTH + ATKDISPLAYPADDING; }; }; @@ -349,10 +357,14 @@ static int draw_sp_attack(struct sp_attack *a, Vector2 p) { //get the image, resize, and draw (too lazy to not get the new image each time //uhhh later when cleaning up this code maybe grab the texture before starting to draw?? - Image img = LoadImage(a->filename); - ImageResize(&img, ATKDISPLAYWIDTH,ATKDISPLAYWIDTH); - Texture2D txtr = LoadTextureFromImage(img); - UnloadImage(img); + //some sort of error is happening here lmaooooo + //it is somehow... drawing the animation?? i think. uh. it's probably a weird memory thing haha + char *imgfilename = a->filename; + printf(imgfilename); + Image imgy = LoadImage(imgfilename); + ImageResize(&imgy, ATKDISPLAYWIDTH,ATKDISPLAYWIDTH); + Texture2D txtr = LoadTextureFromImage(imgy); + UnloadImage(imgy); DrawTexture(txtr,p.x,p.y,WHITE); UnloadTexture(txtr); @@ -404,7 +416,7 @@ static int draw_hp_bar(int hp, int max_hp, Vector2 pos) return 1; }; -Texture2D txtr; +//Texture2D txtr; static int draw_enemy_img(void) { @@ -425,7 +437,7 @@ static int draw_enemy_img(void) int fight_cleanup(void) { - UnloadTexture(txtr); + //UnloadTexture(txtr); UnloadTexture(enemy_img_txtr); UnloadTexture(player_img_txtr); return 1; diff --git a/img/context_fight/attack.png b/img/context_fight/attack.png new file mode 100644 index 0000000..6900af4 Binary files /dev/null and b/img/context_fight/attack.png differ diff --git a/img/context_fight/context.aseprite b/img/context_fight/context.aseprite new file mode 100644 index 0000000..6a9ad3b Binary files /dev/null and b/img/context_fight/context.aseprite differ diff --git a/img/context_fight/normal.png b/img/context_fight/normal.png new file mode 100644 index 0000000..10fed45 Binary files /dev/null and b/img/context_fight/normal.png differ diff --git a/img/defaultatk/attack.aseprite b/img/defaultatk/attack.aseprite new file mode 100644 index 0000000..85e9521 Binary files /dev/null and b/img/defaultatk/attack.aseprite differ diff --git a/img/defaultatk/default.png b/img/defaultatk/default.png new file mode 100644 index 0000000..1723139 Binary files /dev/null and b/img/defaultatk/default.png differ diff --git a/img/defaultatk/icon.png b/img/defaultatk/icon.png new file mode 100644 index 0000000..e29c311 Binary files /dev/null and b/img/defaultatk/icon.png differ diff --git a/img/defaultatk/sheet.png b/img/defaultatk/sheet.png new file mode 100644 index 0000000..7751488 Binary files /dev/null and b/img/defaultatk/sheet.png differ