#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
//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}
};
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;
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;
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;
};
};
{
//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);
return 1;
};
-Texture2D txtr;
+//Texture2D txtr;
static int draw_enemy_img(void)
{
int fight_cleanup(void)
{
- UnloadTexture(txtr);
+ //UnloadTexture(txtr);
UnloadTexture(enemy_img_txtr);
UnloadTexture(player_img_txtr);
return 1;