Initial tile push with item cycle
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
use bevy::prelude::*;
|
||||
|
||||
#[derive(Component)]
|
||||
#[require(Sprite,Transform,Visibility )]
|
||||
pub struct Item {
|
||||
wear: u8,
|
||||
quality: u8,
|
||||
weight: u8,
|
||||
stain_time: u16
|
||||
}
|
||||
|
||||
impl Default for Item {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
wear: 0,
|
||||
quality: 0,
|
||||
weight: 0,
|
||||
stain_time: 16,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Item {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Bundle)]
|
||||
pub struct ItemBundle {
|
||||
pub item: Item,
|
||||
pub transform: Transform,
|
||||
pub sprite: Sprite,
|
||||
pub visibility: Visibility
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Nameable {
|
||||
pub name: String
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Compostable {
|
||||
decay: u8,
|
||||
}
|
||||
Reference in New Issue
Block a user