Skip to content

Commit

Permalink
Add initial values for level progression
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Jul 29, 2024
1 parent 18561f9 commit 7035300
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 30 deletions.
48 changes: 28 additions & 20 deletions assets/config/actor.ron
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

"red": Actor(
name: "Lucy",
weight: 0.1,

texture: "image/actor/red.png",
texture_atlas_grid: TextureAtlasGrid(
Expand All @@ -66,10 +67,12 @@
deck: Deck(cards: ["step", "step", "pair"]),
),

"yellow": Actor(
name: "Lemon",
"purple": Actor(
name: "Lily",
min_level: 2,
weight: 0.4,

texture: "image/actor/yellow.png",
texture: "image/actor/purple.png",
texture_atlas_grid: TextureAtlasGrid(
tile_size: UVec2(8, 8),
columns: 2,
Expand All @@ -82,14 +85,16 @@
],
),

attack: Attack(color: Srgba(Srgba(red: 0.827, green: 0.761, blue: 0.537, alpha: 1.000))),
deck: Deck(cards: ["step", "whole_note", "quarter_rest"]),
attack: Attack(color: Srgba(Srgba(red: 0.694, green: 0.529, blue: 0.788, alpha: 1.000))),
deck: Deck(cards: ["step"]),
),

"green": Actor(
name: "Jade",
"blue": Actor(
name: "Aqua",
min_level: 4,
weight: 0.8,

texture: "image/actor/green.png",
texture: "image/actor/blue.png",
texture_atlas_grid: TextureAtlasGrid(
tile_size: UVec2(8, 8),
columns: 2,
Expand All @@ -102,14 +107,15 @@
],
),

attack: Attack(color: Srgba(Srgba(red: 0.557, green: 0.722, blue: 0.518, alpha: 1.000))),
deck: Deck(cards: ["pair"]),
attack: Attack(color: Srgba(Srgba(red: 0.424, green: 0.694, blue: 0.725, alpha: 1.000))),
deck: Deck(cards: ["step", "pair"]),
),

"blue": Actor(
name: "Aqua",
"green": Actor(
name: "Jade",
min_level: 6,

texture: "image/actor/blue.png",
texture: "image/actor/green.png",
texture_atlas_grid: TextureAtlasGrid(
tile_size: UVec2(8, 8),
columns: 2,
Expand All @@ -122,14 +128,16 @@
],
),

attack: Attack(color: Srgba(Srgba(red: 0.424, green: 0.694, blue: 0.725, alpha: 1.000))),
deck: Deck(cards: ["step", "pair"]),
attack: Attack(color: Srgba(Srgba(red: 0.557, green: 0.722, blue: 0.518, alpha: 1.000))),
deck: Deck(cards: ["pair"]),
),

"purple": Actor(
name: "Lily",
"yellow": Actor(
name: "Lemon",
min_level: 8,
weight: 1.5,

texture: "image/actor/purple.png",
texture: "image/actor/yellow.png",
texture_atlas_grid: TextureAtlasGrid(
tile_size: UVec2(8, 8),
columns: 2,
Expand All @@ -142,8 +150,8 @@
],
),

attack: Attack(color: Srgba(Srgba(red: 0.694, green: 0.529, blue: 0.788, alpha: 1.000))),
deck: Deck(cards: ["step"]),
attack: Attack(color: Srgba(Srgba(red: 0.827, green: 0.761, blue: 0.537, alpha: 1.000))),
deck: Deck(cards: ["step", "whole_note", "quarter_rest"]),
),
},
)
19 changes: 19 additions & 0 deletions assets/config/card.ron
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
description: "A-one and a-two and a-step.",
background: "blue",
icon: "step",
weight: 0.8,

play_sfx: "audio/sfx/Movement.ogg",
action: Step,
Expand All @@ -98,6 +99,7 @@
description: "",
background: "pink",
icon: "eighth_note",
max_level: 2,

action: Attack,
action_modifier: CardActionModifier(
Expand All @@ -110,6 +112,7 @@
description: "",
background: "pink",
icon: "quarter_note",
max_level: 4,

action: Attack,
action_modifier: CardActionModifier(
Expand All @@ -122,6 +125,8 @@
description: "",
background: "pink",
icon: "half_note",
min_level: 2,
max_level: 6,

action: Attack,
action_modifier: CardActionModifier(
Expand All @@ -134,6 +139,7 @@
description: "",
background: "pink",
icon: "whole_note",
min_level: 4,

action: Attack,
action_modifier: CardActionModifier(
Expand All @@ -146,6 +152,8 @@
description: "Two beats, rapid fire!",
background: "pink",
icon: "pair",
max_level: 4,
weight: 0.5,

action: Attack,
action_modifier: CardActionModifier(
Expand Down Expand Up @@ -181,6 +189,9 @@
description: "Heal a little bit",
background: "green",
icon: "eighth_rest",
min_level: 2,
max_level: 4,
weight: 0.5,

action: Heal,
action_modifier: CardActionModifier(heal_flat: 5),
Expand All @@ -190,6 +201,9 @@
description: "Heal 25% health",
background: "green",
icon: "quarter_rest",
min_level: 5,
max_level: 8,
weight: 0.5,

action: Heal,
action_modifier: CardActionModifier(heal_percent: 25),
Expand All @@ -199,6 +213,9 @@
description: "Heal 50% health",
background: "green",
icon: "half_rest",
min_level: 7,
max_level: 10,
weight: 0.5,

action: Heal,
action_modifier: CardActionModifier(heal_percent: 50),
Expand All @@ -208,6 +225,8 @@
description: "Heal 100% health",
background: "green",
icon: "whole_rest",
min_level: 9,
weight: 0.5,

action: Heal,
action_modifier: CardActionModifier(heal_percent: 100),
Expand Down
19 changes: 9 additions & 10 deletions src/game/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ impl Config for ActorConfig {
#[derive(Reflect, Serialize, Deserialize, Clone)]
pub struct Actor {
pub name: String,

#[serde(rename = "texture")]
texture_path: String,
#[serde(skip)]
pub texture: Handle<Image>,
texture_atlas_grid: TextureAtlasGrid,
#[serde(skip)]
pub texture_atlas_layout: Handle<TextureAtlasLayout>,
pub sprite_animation: SpriteAnimation,

/// The earliest level this actor can spawn as an enemy.
#[serde(default)]
pub min_level: usize,
Expand All @@ -102,6 +92,15 @@ pub struct Actor {
#[serde(default = "one")]
pub weight: f64,

#[serde(rename = "texture")]
texture_path: String,
#[serde(skip)]
pub texture: Handle<Image>,
texture_atlas_grid: TextureAtlasGrid,
#[serde(skip)]
pub texture_atlas_layout: Handle<TextureAtlasLayout>,
pub sprite_animation: SpriteAnimation,

#[serde(default)]
pub movement: Movement,
#[serde(default)]
Expand Down

0 comments on commit 7035300

Please sign in to comment.