Skip to content

Commit

Permalink
Changed deck dock to be UI nodes
Browse files Browse the repository at this point in the history
- setup rotation on step
- added add card event
  • Loading branch information
ramirezmike committed Jul 22, 2024
1 parent c723328 commit 974c1ad
Show file tree
Hide file tree
Showing 5 changed files with 220 additions and 161 deletions.
10 changes: 5 additions & 5 deletions assets/config/deck_dock.ron
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(
card_width: 20,
max_dock_width: 100,
max_dock_height: 10,
visible_card_count: 12,
minimum_card_distance: 16,
dock_translation: Vec3(10.0, -35.0, 0.0),
dock_scale: 0.7,
card_width: 20,
dock_height: 20.0,
max_card_scale: 5,
min_card_scale: 1,
)
3 changes: 1 addition & 2 deletions src/game/actor/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use bevy::prelude::*;
use crate::game::actor::actor_helper;
use crate::game::actor::facing::FaceCursor;
use crate::game::actor::facing::FacingIndicator;
use crate::game::deck_dock::DrawDeck;
use crate::util::prelude::*;

pub(super) fn plugin(app: &mut App) {
Expand All @@ -24,7 +23,7 @@ impl Configure for IsPlayer {

pub fn player(entity: EntityWorldMut) {
actor_helper(entity, None)
.insert((IsPlayer, DrawDeck, FaceCursor))
.insert((IsPlayer, FaceCursor))
.with_children(|children| {
children
.spawn_with(FacingIndicator {
Expand Down
10 changes: 3 additions & 7 deletions src/game/card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,23 @@ pub enum CardKey {
// TODO: Remove this `allow` later.
#[allow(dead_code)]
pub struct Card {
pub name: String,
pub description: String,
pub path: String,
pub action: SystemId<Entity>,
}

#[derive(Resource, Deref, DerefMut)]
pub struct CardStorage(pub HashMap<CardKey, Card>);

// TODO: Move this into a sub-folder of storing different attacks?
fn basic_attack(In(entity): In<Entity>) {
println!("Entity {} Attacked", entity);
}
fn basic_attack(In(_): In<Entity>) {}

fn enter_playing(world: &mut World) {
let id = world.register_system(basic_attack);
world.insert_resource(CardStorage(
[(
CardKey::Placeholder,
Card {
name: "Attack".to_string(),
description: "Attack Description".to_string(),
path: "embedded://bevy_jam_5/game/cards/sample_card.png".to_string(),
action: id,
},
)]
Expand Down
Loading

0 comments on commit 974c1ad

Please sign in to comment.