Dummy hand drawing
This commit is contained in:
parent
78af40ba77
commit
19f9dc6e8d
6 changed files with 31 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
|||
/target
|
||||
tags
|
||||
|
|
|
|||
BIN
assets/sprites/card_back_placeholder.png
Normal file
BIN
assets/sprites/card_back_placeholder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
BIN
assets/sprites/card_front_placeholder.png
Normal file
BIN
assets/sprites/card_front_placeholder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
12
src/hand.rs
12
src/hand.rs
|
|
@ -2,10 +2,14 @@ use bevy::prelude::*;
|
|||
|
||||
#[derive(Component)]
|
||||
pub struct Hand {
|
||||
pub name: String,
|
||||
pub cards: Vec<Entity>,
|
||||
pub animals: Vec<Entity>
|
||||
pub name: String
|
||||
}
|
||||
|
||||
impl Hand {
|
||||
pub fn new(name: String) -> Hand {
|
||||
Hand { name }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct HandCard;
|
||||
pub struct HandCard;
|
||||
|
|
|
|||
17
src/lib.rs
17
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<Assets<Mesh>>,
|
||||
mut materials: ResMut<Assets<ColorMaterial>>
|
||||
) {
|
||||
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))))
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue