diff --git a/Makefile b/Makefile index c03917b..27ba792 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ tracy_build: meson compile -j 10 -C builddir test: build - ./builddir/runtests -d yes "[systems-engine]" + ./builddir/runtests -d yes run: build test ifeq '$(OS)' 'Windows_NT' @@ -48,7 +48,7 @@ else endif debug: build - gdb --nx -x .gdbinit --ex run --args builddir/runtests "[systems-engine]" + gdb --nx -x .gdbinit --ex run --args builddir/runtests debug_run: build gdb --nx -x .gdbinit --batch --ex run --ex bt --ex q --args builddir/zedcaster @@ -60,7 +60,7 @@ clean: meson compile --clean -C builddir debug_test: build - gdb --nx -x .gdbinit --ex run --ex bt --ex q --args builddir/runtests "[systems-engine]" + gdb --nx -x .gdbinit --ex run --ex bt --ex q --args builddir/runtests win_installer: powershell 'start "C:\Program Files (x86)\solicus\InstallForge\bin\ifbuilderenvx86.exe" scripts\win_installer.ifp' diff --git a/assets/animation.json b/assets/animation.json index 9c4e368..6108b2d 100644 --- a/assets/animation.json +++ b/assets/animation.json @@ -65,7 +65,7 @@ "close": [] } }, - "rat_with_sword": { + "spider_bot": { "sheet": { "frames": 1, "frame_width": 256, @@ -101,11 +101,11 @@ "hands_sword_attack": { "sheet": { "frames": 3, - "frame_width": 900, - "frame_height": 600 + "frame_width": 512, + "frame_height": 341 }, "sequences": { - "idle": {"frames": [0, 1, 2], "durations": [10, 10, 20] } + "idle": {"frames": [0, 1, 2], "durations": [5, 10, 20] } }, "transforms": { "basic": { @@ -115,7 +115,7 @@ "max_y": 1.0, "flipped": false, "scaled": false, - "toggled": true, + "toggled": false, "looped": false, "relative": false, "easing": "none", diff --git a/assets/config.json b/assets/config.json index 9b0cf86..e5f1d89 100644 --- a/assets/config.json +++ b/assets/config.json @@ -7,18 +7,18 @@ "walk": "assets/sounds/walk.ogg" }, "sprites": { - "rat_with_sword": - {"path": "assets/sprites/rat_with_sword.png", + "spider_bot": + {"path": "assets/sprites/spider_bot.png", "frame_width": 256, "frame_height": 256 }, - "healing_potion_small": - {"path": "assets/items/healing_potion_small.png", + "repair_kit": + {"path": "assets/items/repair_kit.png", "frame_width": 256, "frame_height": 256 }, - "well_down": - {"path": "assets/sprites/well_down.png", + "ladder_down": + {"path": "assets/sprites/ladder_down.png", "frame_width": 256, "frame_height": 256 }, diff --git a/assets/devices.json b/assets/devices.json index 0f52e02..70abeb3 100644 --- a/assets/devices.json +++ b/assets/devices.json @@ -14,7 +14,7 @@ {"_type": "Device", "config": {}, "events": ["STAIRS_DOWN"]}, - {"_type": "Sprite", "name": "well_down", "width": 256, "height": 256, "scale": 1.0} + {"_type": "Sprite", "name": "ladder_down", "width": 256, "height": 256, "scale": 1.0} ] }, "DEAD_BODY_LOOTABLE": { diff --git a/assets/doors/door_plain.png b/assets/doors/door_plain.png index 68474e0..bfca6c6 100644 Binary files a/assets/doors/door_plain.png and b/assets/doors/door_plain.png differ diff --git a/assets/enemies.json b/assets/enemies.json index 4018979..e529d38 100644 --- a/assets/enemies.json +++ b/assets/enemies.json @@ -14,7 +14,7 @@ {"_type": "LightSource", "strength": 35, "radius": 2.0} ] }, - "RAT_GIANT": { + "SPIDER_BOT": { "components": [ {"_type": "Tile", "display": 2220, "foreground": "enemies/fg:rat_giant", @@ -25,8 +25,7 @@ {"_type": "Motion", "dx": 0, "dy": 0, "random": false}, {"_type": "EnemyConfig", "ai_script": "Enemy::actions", "ai_start_name": "Enemy::initial_state", "ai_goal_name": "Enemy::final_state"}, {"_type": "Personality", "hearing_distance": 5, "tough": false}, - {"_type": "Sprite", "name": "rat_with_sword", "scale": 1.0}, - {"_type": "Sound", "attack": "Small_Rat", "death": "Creature_Death_1"} + {"_type": "Sprite", "name": "spider_bot", "scale": 1.0} ] } } diff --git a/assets/hands/hands_sword_attack.png b/assets/hands/hands_sword_attack.png index 1f08a45..4be4e8c 100644 Binary files a/assets/hands/hands_sword_attack.png and b/assets/hands/hands_sword_attack.png differ diff --git a/assets/icons.json b/assets/icons.json index e4672f5..ecccc44 100644 --- a/assets/icons.json +++ b/assets/icons.json @@ -1,6 +1,6 @@ { - "healing_potion_small": - {"path": "assets/icons/healing_potion_small.png", + "repair_kit": + {"path": "assets/icons/repair_kit.png", "frame_width": 96, "frame_height": 96 } diff --git a/assets/icons/healing_potion_small.png b/assets/icons/healing_potion_small.png deleted file mode 100644 index 578cc0e..0000000 Binary files a/assets/icons/healing_potion_small.png and /dev/null differ diff --git a/assets/icons/repair_kit.png b/assets/icons/repair_kit.png new file mode 100644 index 0000000..634e48b Binary files /dev/null and b/assets/icons/repair_kit.png differ diff --git a/assets/items.json b/assets/items.json index 897fcae..ed0be5a 100644 --- a/assets/items.json +++ b/assets/items.json @@ -1,8 +1,8 @@ { - "POTION_HEALING_SMALL": { - "id": "POTION_HEALING_SMALL", - "name": "Small Healing Potion", - "description": "A small healing potion.", + "REPAIR_KIT": { + "id": "REPAIR_KIT", + "name": "Robot Repair Kit", + "description": "A healing item for robots.", "inventory_count": 1, "components": [ {"_type": "Tile", "display": 1003, @@ -10,7 +10,7 @@ "background": "color:transparent" }, {"_type": "Curative", "hp": 20}, - {"_type": "Sprite", "name": "healing_potion_small", "width": 256, "height": 256, "scale": 1.0}, + {"_type": "Sprite", "name": "repair_kit", "width": 256, "height": 256, "scale": 1.0}, {"_type": "Sound", "attack": "pickup", "death": "blank"} ] } diff --git a/assets/items/healing_postion_small.png b/assets/items/healing_postion_small.png deleted file mode 100644 index 5672f42..0000000 Binary files a/assets/items/healing_postion_small.png and /dev/null differ diff --git a/assets/items/healing_potion_small.png b/assets/items/healing_potion_small.png deleted file mode 100644 index 5672f42..0000000 Binary files a/assets/items/healing_potion_small.png and /dev/null differ diff --git a/assets/items/repair_kit.png b/assets/items/repair_kit.png new file mode 100644 index 0000000..a540c09 Binary files /dev/null and b/assets/items/repair_kit.png differ diff --git a/assets/sprites/dead_body.png b/assets/sprites/dead_body.png index 4d0ef1c..cb6a592 100644 Binary files a/assets/sprites/dead_body.png and b/assets/sprites/dead_body.png differ diff --git a/assets/sprites/dead_body_lootable.png b/assets/sprites/dead_body_lootable.png index e4a1187..cb6a592 100644 Binary files a/assets/sprites/dead_body_lootable.png and b/assets/sprites/dead_body_lootable.png differ diff --git a/assets/sprites/ladder_down.png b/assets/sprites/ladder_down.png new file mode 100644 index 0000000..d80862b Binary files /dev/null and b/assets/sprites/ladder_down.png differ diff --git a/assets/sprites/spider_bot.png b/assets/sprites/spider_bot.png new file mode 100644 index 0000000..4b912a4 Binary files /dev/null and b/assets/sprites/spider_bot.png differ diff --git a/assets/sprites/well_down.png b/assets/sprites/well_down.png deleted file mode 100644 index f84bfd1..0000000 Binary files a/assets/sprites/well_down.png and /dev/null differ diff --git a/assets/textures/ceiling_black.png b/assets/textures/ceiling_black.png index 28099d3..b17688f 100644 Binary files a/assets/textures/ceiling_black.png and b/assets/textures/ceiling_black.png differ diff --git a/assets/textures/floor_gray_stone.png b/assets/textures/floor_gray_stone.png index 55405e5..d03a1a8 100644 Binary files a/assets/textures/floor_gray_stone.png and b/assets/textures/floor_gray_stone.png differ diff --git a/assets/textures/floor_plain.png b/assets/textures/floor_plain.png deleted file mode 100644 index 55405e5..0000000 Binary files a/assets/textures/floor_plain.png and /dev/null differ diff --git a/assets/textures/wall_plain.png b/assets/textures/wall_plain.png index a4063bd..a7ad29d 100644 Binary files a/assets/textures/wall_plain.png and b/assets/textures/wall_plain.png differ diff --git a/src/game/worldbuilder.cpp b/src/game/worldbuilder.cpp index 2c2ea23..c7f25f7 100644 --- a/src/game/worldbuilder.cpp +++ b/src/game/worldbuilder.cpp @@ -201,7 +201,7 @@ void WorldBuilder::configure_starting_items(DinkyECS::World &world) { auto& player = world.get_the(); auto &inventory = world.get(player.entity); - auto healing = System::spawn_item(world, "POTION_HEALING_SMALL"); + auto healing = System::spawn_item(world, "REPAIR_KIT"); inventory.add("pocket_l", healing); world.make_constant(healing); } diff --git a/src/gui/debug_ui.cpp b/src/gui/debug_ui.cpp index f703a5c..ce25a0d 100644 --- a/src/gui/debug_ui.cpp +++ b/src/gui/debug_ui.cpp @@ -19,7 +19,7 @@ namespace gui { "[spawn1|spawn2|spawn3]" "[spawn4|spawn5|spawn6]"); - add_spawn_button("RAT_GIANT", "rat_with_sword", "spawn4"); + // add_spawn_button("RAT_GIANT", "rat_with_sword", "spawn4"); $gui.init(); } diff --git a/src/gui/main_ui.cpp b/src/gui/main_ui.cpp index 855ca36..559df5e 100644 --- a/src/gui/main_ui.cpp +++ b/src/gui/main_ui.cpp @@ -19,6 +19,9 @@ namespace gui { auto config = settings::get("config"); $hand = textures::get_sprite(config["player"]["hands"]); $hand_anim = animation::load("assets/animation.json", config["player"]["hands"]); + int width = $hand_anim.sheet.frame_width; + int height = $hand_anim.sheet.frame_height; + $hand.sprite->setPosition({float(RAY_VIEW_X + (RAY_VIEW_WIDTH - width) / 2), float(RAY_VIEW_HEIGHT - height)}); } void MainUI::dirty() { @@ -147,7 +150,6 @@ namespace gui { if($hand_anim.playing) { $hand_anim.update(); $hand_anim.apply(*$hand.sprite); - $hand.sprite->setPosition({RAY_VIEW_X, RAY_VIEW_Y}); $window.draw(*$hand.sprite); } } diff --git a/tests/loot.cpp b/tests/loot.cpp index 6f72bd2..eac74fe 100644 --- a/tests/loot.cpp +++ b/tests/loot.cpp @@ -10,12 +10,12 @@ using namespace components; TEST_CASE("test the loot ui", "[loot]") { auto items = settings::get("assets/items.json"); DinkyECS::World world; - auto torch = world.entity(); - auto& data = items["TORCH_BAD"]; + auto repair_kit = world.entity(); + auto& data = items["REPAIR_KIT"]; components::init(); - components::configure_entity(world, torch, data["components"]); + components::configure_entity(world, repair_kit, data["components"]); - auto& torch_sprite = world.get(torch); - REQUIRE(torch_sprite.name == "torch_horizontal_floor"); + auto& repair_kit_sprite = world.get(repair_kit); + REQUIRE(repair_kit_sprite.name == "repair_kit"); } diff --git a/tests/mazes.cpp b/tests/mazes.cpp index 8e855a1..d66a71b 100644 --- a/tests/mazes.cpp +++ b/tests/mazes.cpp @@ -7,7 +7,7 @@ #include "algos/maze.hpp" #include "algos/stats.hpp" -#define DUMP 1 +#define DUMP 0 using std::string; using matrix::Matrix; diff --git a/tests/textures.cpp b/tests/textures.cpp index eb5d490..50d3c8e 100644 --- a/tests/textures.cpp +++ b/tests/textures.cpp @@ -11,13 +11,13 @@ TEST_CASE("test texture management", "[textures]") { components::init(); textures::init(); - auto spider = textures::get_sprite("rat_with_sword"); + auto spider = textures::get_sprite("spider_bot"); REQUIRE(spider.sprite != nullptr); REQUIRE(spider.texture != nullptr); REQUIRE(spider.frame_size.x == TEXTURE_WIDTH); REQUIRE(spider.frame_size.y == TEXTURE_HEIGHT); - auto image = textures::load_image("assets/sprites/rat_with_sword.png"); + auto image = textures::load_image("assets/sprites/spider_bot.png"); size_t floor_tile = textures::get_id("floor_tile"); size_t gray_stone = textures::get_id("door_plain");