diff --git a/.gitignore b/.gitignore index ea8c4bf..c2a9b6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +tags diff --git a/assets/sprites/card_back_placeholder.png b/assets/sprites/card_back_placeholder.png new file mode 100644 index 0000000..cbfc664 Binary files /dev/null and b/assets/sprites/card_back_placeholder.png differ diff --git a/assets/sprites/card_front_placeholder.png b/assets/sprites/card_front_placeholder.png new file mode 100644 index 0000000..158d404 Binary files /dev/null and b/assets/sprites/card_front_placeholder.png differ diff --git a/src/hand.rs b/src/hand.rs index 45cb1ab..ddbaefa 100644 --- a/src/hand.rs +++ b/src/hand.rs @@ -2,10 +2,14 @@ use bevy::prelude::*; #[derive(Component)] pub struct Hand { - pub name: String, - pub cards: Vec, - pub animals: Vec + pub name: String +} + +impl Hand { + pub fn new(name: String) -> Hand { + Hand { name } + } } #[derive(Component)] -pub struct HandCard; \ No newline at end of file +pub struct HandCard; diff --git a/src/lib.rs b/src/lib.rs index 721b4c6..ca3a70d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,20 @@ +use bevy::prelude::*; +use crate::hand::Hand; + pub mod hand; pub mod animal; pub mod properties; + +pub fn setup( + mut commands: Commands, + mut meshes: ResMut>, + mut materials: ResMut> +) { + commands.spawn(Camera2d); + commands.spawn(( + Hand::new("Player1".to_string()), + Transform::from_xyz(0., -300., 0.), + Mesh2d(meshes.add(Rectangle::new(100., 100.))), + MeshMaterial2d(materials.add(ColorMaterial::from_color(Srgba::rgb(0.5, 0.5, 0.5)))) + )); +} diff --git a/src/main.rs b/src/main.rs index 98948e3..91ae78e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,12 @@ use bevy::prelude::*; -use evolution_rs::properties::plugin::BasePropertiesPlugin; +use evolution_rs::{ + properties::plugin::BasePropertiesPlugin, + setup +}; fn main() { App::new() .add_plugins((DefaultPlugins,BasePropertiesPlugin)) + .add_systems(Startup, setup) .run(); }