generated from 2ndbeam/bevy-template
refactor!: Item changes
- Bump version to 0.3.0 - Moved crate::inventory::item to crate::item - Made Item.position non-option - Renamed Item::new_positioned -> Item::new - Removed old Item::new method - Changed Inventory.can_fit signature to use item borrow
This commit is contained in:
parent
42cfd14214
commit
528c511445
13 changed files with 81 additions and 86 deletions
|
|
@ -1,20 +0,0 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
use super::*;
|
||||
|
||||
// TODO: replace with proper sprite
|
||||
const LOCKPICK_SPRITE: &'static str = "sprites/items/choco_bar.png";
|
||||
|
||||
#[derive(Component, Debug, PartialEq, Eq, Default, Clone, Copy, Reflect)]
|
||||
#[reflect(Component, Debug, PartialEq, Default, Clone)]
|
||||
#[require(Item)]
|
||||
pub struct Lockpick;
|
||||
|
||||
pub fn lockpick_bundle(asset_server: &Res<AssetServer>, position: UVec2) -> impl Bundle {
|
||||
let image = asset_server.load(LOCKPICK_SPRITE);
|
||||
(
|
||||
Item::new_positioned(uvec2(1, 1), position),
|
||||
ItemImage(image),
|
||||
Lockpick,
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue