First commit that disconnects this game from the game framework so it can be its own thing.
6
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'
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 1.8 KiB |
|
|
@ -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}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 41 KiB |
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 1.9 KiB |
BIN
assets/icons/repair_kit.png
Normal file
|
After Width: | Height: | Size: 912 B |
|
|
@ -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"}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
BIN
assets/items/repair_kit.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 20 KiB |
BIN
assets/sprites/ladder_down.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
assets/sprites/spider_bot.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 1.5 KiB |
|
|
@ -201,7 +201,7 @@ void WorldBuilder::configure_starting_items(DinkyECS::World &world) {
|
|||
auto& player = world.get_the<Player>();
|
||||
auto &inventory = world.get<inventory::Model>(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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Sprite>(torch);
|
||||
REQUIRE(torch_sprite.name == "torch_horizontal_floor");
|
||||
auto& repair_kit_sprite = world.get<Sprite>(repair_kit);
|
||||
REQUIRE(repair_kit_sprite.name == "repair_kit");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "algos/maze.hpp"
|
||||
#include "algos/stats.hpp"
|
||||
|
||||
#define DUMP 1
|
||||
#define DUMP 0
|
||||
|
||||
using std::string;
|
||||
using matrix::Matrix;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||