Skip to content

Commit

Permalink
finish repeater and polyp art, add 1 and 5 currency
Browse files Browse the repository at this point in the history
  • Loading branch information
cdsupina committed Aug 28, 2019
1 parent dafe3bf commit 4f21795
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
Binary file removed assets/texture/receiver_boss.png
Binary file not shown.
Binary file added assets/texture/repeater_boss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/texture/spritesheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/texture/spritesheet.ron
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,11 @@
width: 12,
height: 12,
),
(
x: 56,
y: 47,
width: 7,
height: 7,
),
],
)
35 changes: 27 additions & 8 deletions src/entities/enemy_spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const CONSUMABLE_SPEED: f32 = 35.0;

const CONSUMABLE_HEALTH_RATIO: usize = 22;
const CONSUMABLE_DEFENSE_RATIO: usize = 3;
const CONSUMABLE_MONEY_RATIO: usize = 75;
const CONSUMABLE_MONEY_1_RATIO: usize = 70;
const CONSUMABLE_MONEY_5_RATIO: usize = 5;

const ENEMY_HEIGHT: f32 = 18.0;
const ENEMY_WIDTH: f32 = 18.0;
Expand Down Expand Up @@ -58,7 +59,9 @@ const HAULER_SPRITE_INDEX: usize = 15;

const HEALTH_CONSUMABLE_SPRITE_INDEX: usize = 13;
const DEFENSE_CONSUMABLE_SPRITE_INDEX: usize = 14;
const MONEY_CONSUMABLE_SPRITE_INDEX: usize = 16;
const MONEY_1_CONSUMABLE_SPRITE_INDEX: usize = 17;
const MONEY_5_CONSUMABLE_SPRITE_INDEX: usize = 16;


const SPAWNER_Y_OFFSET: f32 = 20.0;

Expand All @@ -74,8 +77,11 @@ pub fn initialise_enemy_spawner(world: &mut World) {
for _ in 0..CONSUMABLE_DEFENSE_RATIO {
consumables_list.push("defense".to_string());
}
for _ in 0..CONSUMABLE_MONEY_RATIO {
consumables_list.push("money".to_string());
for _ in 0..CONSUMABLE_MONEY_1_RATIO {
consumables_list.push("money_1".to_string());
}
for _ in 0..CONSUMABLE_MONEY_5_RATIO {
consumables_list.push("money_5".to_string());
}

let health_consumable = Consumable {
Expand All @@ -102,22 +108,35 @@ pub fn initialise_enemy_spawner(world: &mut World) {
speed: CONSUMABLE_SPEED,
};

let money_consumable = Consumable {
let money_1_consumable = Consumable {
width: 7.0,
height: 7.0,
hitbox_width: 6.0,
hitbox_height: 6.0,
health_value: 0.0,
defense_value: 0.0,
money_value: 1,
sprite_index: MONEY_1_CONSUMABLE_SPRITE_INDEX,
speed: CONSUMABLE_SPEED,
};

let money_5_consumable = Consumable {
width: CONSUMABLE_WIDTH,
height: CONSUMABLE_HEIGHT,
hitbox_width: CONSUMABLE_HITBOX_WIDTH,
hitbox_height: CONSUMABLE_HITBOX_HEIGHT,
health_value: 0.0,
defense_value: 0.0,
money_value: 1,
sprite_index: MONEY_CONSUMABLE_SPRITE_INDEX,
money_value: 5,
sprite_index: MONEY_5_CONSUMABLE_SPRITE_INDEX,
speed: CONSUMABLE_SPEED,
};

let mut consumables = HashMap::new();
consumables.insert("health".to_string(), health_consumable);
consumables.insert("defense".to_string(), defense_consumable);
consumables.insert("money".to_string(), money_consumable);
consumables.insert("money_1".to_string(), money_1_consumable);
consumables.insert("money_5".to_string(), money_5_consumable);

//create consumable pools for enemies
let standard_pool = Pool {
Expand Down

0 comments on commit 4f21795

Please sign in to comment.