diff --git a/src/main.c b/src/main.c index 8b7e73a..7c7af47 100644 --- a/src/main.c +++ b/src/main.c @@ -184,7 +184,7 @@ initMainMenu(void) int hcenter; Sprite *s1 = sprite_create(); - sprite_load_text_texture(s1, "assets/GUI/SDS_8x8.ttf", 0, 20); + sprite_load_text_texture(s1, "assets/GUI/SDS_8x8.ttf", 0, 25); texture_load_from_text(s1->textures[0], menu_items[i].label, C_DEFAULT, gRenderer); @@ -193,7 +193,7 @@ initMainMenu(void) s1->fixed = true; Sprite *s2 = sprite_create(); - sprite_load_text_texture(s2, "assets/GUI/SDS_8x8.ttf", 0, 20); + sprite_load_text_texture(s2, "assets/GUI/SDS_8x8.ttf", 0, 25); texture_load_from_text(s2->textures[0], menu_items[i].label, C_HOVER, gRenderer); @@ -209,6 +209,11 @@ resetGame(void) { SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT); + if (mainMenu) { + menu_destroy(mainMenu); + mainMenu = NULL; + } + if (gMap) map_destroy(gMap); diff --git a/src/monster.c b/src/monster.c index 55b8ed6..19e43f6 100644 --- a/src/monster.c +++ b/src/monster.c @@ -236,7 +236,7 @@ monster_hit(Monster *monster, unsigned int dmg) p.x += 8; p.y += 8; Dimension d = { 8, 8 }; - particle_engine_bloodspray(p, d); + particle_engine_bloodspray(p, d, dmg); } else { monster->missText->active = true; monster->hitText->active = false; diff --git a/src/particle_engine.c b/src/particle_engine.c index 93f64ae..bed47e8 100644 --- a/src/particle_engine.c +++ b/src/particle_engine.c @@ -38,12 +38,15 @@ particle_engine_init(void) } void -particle_engine_bloodspray(Position pos, Dimension dim) +particle_engine_bloodspray(Position pos, Dimension dim, unsigned int count) { check_engine(); - for (unsigned int i = 0; i < 15; ++i) { + if (count > 100) + count = 100; + + for (unsigned int i = 0; i < count; ++i) { int x, y, xv, yv, w, h; unsigned int mt, lt; Particle *p; diff --git a/src/particle_engine.h b/src/particle_engine.h index c232c56..09bbd35 100644 --- a/src/particle_engine.h +++ b/src/particle_engine.h @@ -10,7 +10,7 @@ void particle_engine_init(void); void -particle_engine_bloodspray(Position, Dimension); +particle_engine_bloodspray(Position, Dimension, unsigned int count); void particle_engine_update(float deltatime); diff --git a/src/player.c b/src/player.c index 9019732..e7feafe 100644 --- a/src/player.c +++ b/src/player.c @@ -313,7 +313,7 @@ player_hit(Player *p, unsigned int dmg) Position pos = p->sprite->pos; pos.x += 8; pos.y += 8; - particle_engine_bloodspray(pos, (Dimension) { 8, 8 }); + particle_engine_bloodspray(pos, (Dimension) { 8, 8 }, dmg); } else { p->missText->active = true; p->hitText->active = false;