mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-17 04:45:02 +01:00
Add more items
This commit is contained in:
parent
f7290847a8
commit
4bcbbaebb8
3 changed files with 34 additions and 0 deletions
15
src/game.rs
15
src/game.rs
|
|
@ -69,6 +69,21 @@ impl GameState {
|
||||||
if input.pressed(Key::Num5) {
|
if input.pressed(Key::Num5) {
|
||||||
self.selected_inv_slot = 4;
|
self.selected_inv_slot = 4;
|
||||||
}
|
}
|
||||||
|
if input.pressed(Key::Num6) {
|
||||||
|
self.selected_inv_slot = 5;
|
||||||
|
}
|
||||||
|
if input.pressed(Key::Num7) {
|
||||||
|
self.selected_inv_slot = 6;
|
||||||
|
}
|
||||||
|
if input.pressed(Key::Num8) {
|
||||||
|
self.selected_inv_slot = 7;
|
||||||
|
}
|
||||||
|
if input.pressed(Key::Num9) {
|
||||||
|
self.selected_inv_slot = 8;
|
||||||
|
}
|
||||||
|
if input.pressed(Key::Num0) {
|
||||||
|
self.selected_inv_slot = 9;
|
||||||
|
}
|
||||||
self.world.ticks += 1;
|
self.world.ticks += 1;
|
||||||
}
|
}
|
||||||
pub(crate) fn draw_world(&mut self, rt: &mut RenderTexture, res: &mut Res) {
|
pub(crate) fn draw_world(&mut self, rt: &mut RenderTexture, res: &mut Res) {
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,14 @@ impl Inventory {
|
||||||
id: items::PLATFORM,
|
id: items::PLATFORM,
|
||||||
qty: 100,
|
qty: 100,
|
||||||
},
|
},
|
||||||
|
Slot {
|
||||||
|
id: items::STONE_WALL,
|
||||||
|
qty: 100,
|
||||||
|
},
|
||||||
|
Slot {
|
||||||
|
id: items::PANZERIUM,
|
||||||
|
qty: 100,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -126,6 +134,15 @@ impl Default for ItemDb {
|
||||||
},
|
},
|
||||||
consumable: true,
|
consumable: true,
|
||||||
},
|
},
|
||||||
|
ItemDef {
|
||||||
|
name: String::from("Stone wall"),
|
||||||
|
graphic_name: String::from("tiles/stoneback"),
|
||||||
|
tex_rect: IntRect::default(),
|
||||||
|
use_action: UseAction::PlaceBgTile {
|
||||||
|
id: BgTileId::STONE,
|
||||||
|
},
|
||||||
|
consumable: true,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -138,4 +155,6 @@ pub mod items {
|
||||||
pub const TORCH: ItemId = 1;
|
pub const TORCH: ItemId = 1;
|
||||||
pub const PLATFORM: ItemId = 2;
|
pub const PLATFORM: ItemId = 2;
|
||||||
pub const WOOD_PICK: ItemId = 3;
|
pub const WOOD_PICK: ItemId = 3;
|
||||||
|
pub const PANZERIUM: ItemId = 4;
|
||||||
|
pub const STONE_WALL: ItemId = 5;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
tiles.dat
BIN
tiles.dat
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue