diff --git a/assets/config.json b/assets/config.json index e5f1d89..f521e8b 100644 --- a/assets/config.json +++ b/assets/config.json @@ -17,6 +17,11 @@ "frame_width": 256, "frame_height": 256 }, + "sword_1": + {"path": "assets/items/sword_1_sprite.png", + "frame_width": 256, + "frame_height": 256 + }, "ladder_down": {"path": "assets/sprites/ladder_down.png", "frame_width": 256, diff --git a/assets/icons.json b/assets/icons.json index ecccc44..418cc89 100644 --- a/assets/icons.json +++ b/assets/icons.json @@ -3,5 +3,10 @@ {"path": "assets/icons/repair_kit.png", "frame_width": 96, "frame_height": 96 + }, + "sword_1": + {"path": "assets/icons/sword_1_icon.png", + "frame_width": 300, + "frame_height": 100 } } diff --git a/assets/icons/sword_1_icon.png b/assets/icons/sword_1_icon.png new file mode 100644 index 0000000..6d38330 Binary files /dev/null and b/assets/icons/sword_1_icon.png differ diff --git a/assets/items.json b/assets/items.json index ed0be5a..61d824d 100644 --- a/assets/items.json +++ b/assets/items.json @@ -13,5 +13,19 @@ {"_type": "Sprite", "name": "repair_kit", "width": 256, "height": 256, "scale": 1.0}, {"_type": "Sound", "attack": "pickup", "death": "blank"} ] + }, + "SWORD_1": { + "id": "SWORD_1", + "name": "Robot Repair Kit", + "description": "A healing item for robots.", + "inventory_count": 1, + "components": [ + {"_type": "Tile", "display": 1004, + "foreground": "items/fg:potion", + "background": "color:transparent" + }, + {"_type": "Sprite", "name": "sword_1", "width": 300, "height": 100, "scale": 1.0}, + {"_type": "Sound", "attack": "pickup", "death": "blank"} + ] } } diff --git a/assets/items/sword_1_sprite.png b/assets/items/sword_1_sprite.png new file mode 100644 index 0000000..2b84057 Binary files /dev/null and b/assets/items/sword_1_sprite.png differ diff --git a/src/game/worldbuilder.cpp b/src/game/worldbuilder.cpp index ee420ea..b596ff2 100644 --- a/src/game/worldbuilder.cpp +++ b/src/game/worldbuilder.cpp @@ -204,8 +204,8 @@ void WorldBuilder::configure_starting_items(DinkyECS::World &world) { auto healing = System::spawn_item(world, "REPAIR_KIT"); inventory.add("inv0", healing); - healing = System::spawn_item(world, "REPAIR_KIT"); - inventory.add("inv1", healing); + auto sword = System::spawn_item(world, "SWORD_1"); + inventory.add("hand_main", sword); world.make_constant(healing); }