diff --git a/assets/config.json b/assets/config.json index ad099ad..0f35f0b 100644 --- a/assets/config.json +++ b/assets/config.json @@ -32,7 +32,8 @@ "trash_button": "assets/trash_button.png", "axe_ranger": "assets/axe_ranger-256.png", "hairy_spider": "assets/hairy_spider-256.png", - "down_the_well": "assets/down_the_well.jpg" + "down_the_well": "assets/down_the_well.jpg", + "boss_fight": "assets/rat-king-boss-fight-test-small.jpg" }, "enemy": { "HEARING_DISTANCE": 5 diff --git a/assets/rat-king-boss-fight-test-small.jpg b/assets/rat-king-boss-fight-test-small.jpg new file mode 100644 index 0000000..5ad3dd6 Binary files /dev/null and b/assets/rat-king-boss-fight-test-small.jpg differ diff --git a/assets/tiles.json b/assets/tiles.json index 53a28c4..969b072 100644 --- a/assets/tiles.json +++ b/assets/tiles.json @@ -7,7 +7,7 @@ "display":"\u289e" }, "WALL_PLAIN": { - "texture": "assets/wall_simple-256.png", + "texture": "assets/wall_texture_test-256.png", "foreground": [230, 20, 30], "background": [230, 20, 120], "collision": true, @@ -19,12 +19,5 @@ "background": [230, 20, 120], "collision": false, "display":"\u0799" - }, - "WALL_PILLAR": { - "texture": "assets/wall_with_pillars-256.png", - "foreground": [230, 20, 30], - "background": [230, 20, 120], - "collision": false, - "display":"\u2274" } } diff --git a/boss_fight_ui.cpp b/boss_fight_ui.cpp new file mode 100644 index 0000000..2a924de --- /dev/null +++ b/boss_fight_ui.cpp @@ -0,0 +1,82 @@ +#include "boss_fight_ui.hpp" +#include "easings.hpp" + +namespace gui { + BossFightUI::BossFightUI() { + $status.position(0, 0, 300, SCREEN_HEIGHT); + $status.layout( + "[(150)status_1|(150)status_2]" + "[(150)status_3|(150)status_4]" + "[(150)status_5|(150)status_6]" + "[(150)status_7|(150)status_8]" + ); + + $overlay.position(300, 0, SCREEN_WIDTH - 300, SCREEN_HEIGHT); + $overlay.layout("[overlay_1|overlay_2|overlay_3|overlay_4]" + "[overlay_5|overlay_6|overlay_7|overlay_8]" + "[overlay_9|overlay_10|overlay_11|overlay_12]" + "[overlay_13|overlay_14|overlay_15|overlay_16]"); + + $boss_image = textures::get("boss_fight"); + auto bounds = $boss_image.sprite->getLocalBounds(); + $boss_image.sprite->setPosition({300 + bounds.size.x / 2, bounds.size.y / 2}); + $boss_image.sprite->setOrigin({bounds.size.x / 2, bounds.size.y / 2}); + } + + void BossFightUI::init() { + $status.world().set_the({$status.$parser}); + + for(auto& [name, cell] : $status.cells()) { + auto button = $status.entity(name); + $status.set(button, {}); + $status.set(button, { + [this, name](auto, auto){ fmt::println("STATUS: {}", name); } + }); + $status.set