Skip to content

Commit 2bbd85d

Browse files
committed
Minor adjustments
1 parent d127524 commit 2bbd85d

4 files changed

Lines changed: 49 additions & 48 deletions

File tree

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
- **Health Point System**: Start with 100 HP - bigger asteroids deal more damage!
2626
- **Shield System**: Collect shield items to activate temporary shields that absorb damage
2727
- **Variable Damage**: Damage scales with asteroid size and bullet type
28-
- **Enemy Health System**: Enemies have 50 HP and take multiple hits to destroy
28+
- **Enemy Health System**: Enemies have 30 HP and take multiple hits to destroy
2929
- **High Score System**: Your high score is automatically saved and persists between sessions
3030

3131
## Controls
@@ -96,7 +96,7 @@ The game features a mission-based progression system:
9696

9797
### Scoring
9898
- **Asteroids**: 100 points each
99-
- **Enemy Ships**: 500 points each (10 points per HP, enemies have 50 HP)
99+
- **Enemy Ships**: 300 points each (10 points per HP, enemies have 30 HP)
100100

101101
### Loot System
102102

@@ -108,20 +108,19 @@ Loot items drop from destroyed asteroids and enemies:
108108
- **Nothing** (35% chance)
109109

110110
**From Rare Asteroids** (10% chance to spawn, always drop loot):
111-
- **Gold (Rare Metal)** (40% chance): 2-5 pieces
112-
- **Rust Piles (Scrap)** (20% chance): 5-9 pieces
113-
- **Health Pack** (15% chance): Restores health points
114-
- **Rapid Fire Boost** (12% chance): Rapid fire for 10 seconds (3x faster shooting)
115-
- **Big Bullet Boost** (7% chance): Bigger, more powerful bullets for 15 seconds (20 damage vs 10)
116-
- **Shield** (6% chance): Activates shield with 50-150 HP that lasts 30 seconds
111+
- **Gold (Rare Metal)** (30% chance): 2-5 pieces
112+
- **Rust Piles (Scrap)** (15% chance): 5-9 pieces
113+
- **Health Pack** (25% chance): Restores 25 HP
114+
- **Rapid Fire Boost** (18% chance): Rapid fire for 10 seconds (3x faster shooting)
115+
- **Big Bullet Boost** (12% chance): Bigger, more powerful bullets for 15 seconds (30 damage vs 15)
117116

118117
**From Enemy Ships:**
119-
- **Rust Piles (Scrap)** (45% chance): 5-9 pieces
120-
- **Health Pack** (15% chance): Restores health points
121-
- **Rapid Fire Boost** (12% chance): Rapid fire for 10 seconds (3x faster shooting)
122-
- **Big Bullet Boost** (10% chance): Bigger, more powerful bullets for 15 seconds (20 damage vs 10)
123-
- **Shield** (10% chance): Activates shield with 30-100 HP that lasts 30 seconds
124-
- **Nothing** (8% chance)
118+
- **Rust Piles (Scrap)** (30% chance): 5-9 pieces
119+
- **Health Pack** (25% chance): Restores 25 HP
120+
- **Rapid Fire Boost** (18% chance): Rapid fire for 10 seconds (3x faster shooting)
121+
- **Big Bullet Boost** (12% chance): Bigger, more powerful bullets for 15 seconds (30 damage vs 15)
122+
- **Shield** (8% chance): Activates shield with 30-100 HP that lasts 30 seconds
123+
- **Nothing** (7% chance)
125124

126125
**Note**: Health packs, weapon boosts, and shields do NOT count toward resource collection objectives
127126

@@ -149,15 +148,15 @@ Loot items drop from destroyed asteroids and enemies:
149148
- Medium fragments (radius 20): ~10 HP damage
150149
- Small fragments (radius 10): ~5 HP damage
151150
- **Enemy Bullets**: Deal 15 HP damage
152-
- **Player Bullets**: Deal 10 HP damage to enemies (20 HP with big bullet boost)
153-
- **Enemy Health**: Enemies have 50 HP and take multiple hits to destroy
151+
- **Player Bullets**: Deal 15 HP damage to enemies (30 HP with big bullet boost)
152+
- **Enemy Health**: Enemies have 30 HP and take multiple hits to destroy
154153
- Complete mission objectives to progress (kills, rust piles, and gold)
155154
- Destroy asteroids to break them into smaller pieces
156155
- Rare asteroids (10% spawn chance) have distinct appearance and always drop loot
157156
- Enemy ships spawn based on mission configuration and track your position
158-
- Enemies have 50 HP and shoot at you - destroy them to complete kill objectives
157+
- Enemies have 30 HP and shoot at you - destroy them to complete kill objectives
159158
- Collect rust piles and gold separately - missions require specific amounts of each
160-
- Health packs restore HP (capped at maximum)
159+
- Health packs restore 25 HP (capped at maximum of 100 HP)
161160
- **Rapid Fire Boost**: Reduces shooting cooldown by 3x for 10 seconds
162161
- **Big Bullet Boost**: Shoots larger, more powerful bullets (20 damage) for 15 seconds
163162
- **Shield**: Activates a temporary shield that absorbs damage before it reaches your health

src/components.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl EnemyShip {
153153
};
154154
let y = gen_range(50.0, screen_height() - 50.0);
155155
let speed_x = if side == 0 { 120.0 } else { -120.0 }; // Use constant or number
156-
let max_health = 50.0;
156+
let max_health = 30.0;
157157
Self {
158158
pos: vec2(x, y),
159159
vel: vec2(speed_x, gen_range(-20.0, 20.0)),

src/game.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ pub const ACCELERATION: f32 = 150.0;
1010
pub const BULLET_SPEED: f32 = 400.0;
1111
pub const BULLET_LIFETIME: f32 = 2.0;
1212
pub const SHOOT_COOLDOWN: f32 = 0.3;
13-
pub const PLAYER_BULLET_DAMAGE: f32 = 10.0;
13+
pub const PLAYER_BULLET_DAMAGE: f32 = 15.0;
1414
pub const PLAYER_BULLET_RADIUS: f32 = 6.0;
15-
pub const BIG_BULLET_DAMAGE: f32 = 20.0;
15+
pub const BIG_BULLET_DAMAGE: f32 = 30.0;
1616
pub const BIG_BULLET_RADIUS: f32 = 12.0;
1717
pub const ENEMY_BULLET_DAMAGE: f32 = 15.0;
1818
pub const BASE_ASTEROID_DAMAGE: f32 = 5.0;
@@ -78,8 +78,14 @@ impl Game {
7878
self.mission_rare_metal_collected = 0;
7979
self.enemy_spawn_timer = self.current_mission.enemy_spawn_interval;
8080

81+
// Reset ship position and movement, restore health to full
8182
self.ship.pos = vec2(screen_width() / 2.0, screen_height() / 2.0);
8283
self.ship.vel = vec2(0.0, 0.0);
84+
self.ship.rotation = 0.0;
85+
self.ship.engine.current_thrust = 0.0;
86+
// Restore health to 100%
87+
self.ship.health = self.ship.max_health;
88+
// Note: scrap, rare_metal, shield state, and boost timers are preserved between missions
8389
}
8490

8591
pub fn next_mission(&mut self) {

src/systems.rs

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -113,55 +113,51 @@ pub fn generate_loot(pos: Vec2, source: LootSource) -> Option<LootItem> {
113113
}
114114
LootSource::RareAsteroid => {
115115
// Rare asteroids always drop loot (100% chance)
116-
if roll < 40 {
116+
if roll < 30 {
117117
(LootType::RareMetal(gen_range(2, 5)), 12.0)
118118
}
119-
// 40% chance of rare metal (decreased from 50% to make room for other items)
120-
else if roll < 60 {
119+
// 30% chance of rare metal
120+
else if roll < 45 {
121121
(LootType::Scrap(gen_range(5, 10)), 10.0)
122122
}
123-
// 20% chance of scrap (decreased from 25%)
124-
else if roll < 75 {
125-
(LootType::HealthPack(1), 15.0)
123+
// 15% chance of scrap
124+
else if roll < 70 {
125+
(LootType::HealthPack(25), 15.0)
126126
}
127-
// 15% chance of health pack (increased from 10%)
128-
else if roll < 87 {
127+
// 25% chance of health pack
128+
else if roll < 88 {
129129
(LootType::RapidFireBoost, 15.0)
130130
}
131-
// 12% chance of rapid fire boost (increased from 7%)
132-
else if roll < 94 {
133-
(LootType::BigBulletBoost, 15.0)
134-
}
135-
// 7% chance of big bullet boost (increased from 3%)
131+
// 18% chance of rapid fire boost
136132
else {
137-
// 6% chance of shield with varying HP (50-150 HP) (increased from 5%)
138-
(LootType::Shield(gen_range(50, 151)), 15.0)
133+
// 12% chance of big bullet boost (roll 88-99)
134+
(LootType::BigBulletBoost, 15.0)
139135
}
140136
}
141137
LootSource::EnemySmall => {
142-
if roll < 45 {
138+
if roll < 30 {
143139
(LootType::Scrap(gen_range(5, 10)), 10.0)
144140
}
145-
// 45% chance of scrap (increased from 30%)
146-
else if roll < 60 {
147-
(LootType::HealthPack(1), 15.0)
141+
// 30% chance of scrap
142+
else if roll < 55 {
143+
(LootType::HealthPack(25), 15.0)
148144
}
149-
// 15% health pack (increased from 10%)
150-
else if roll < 72 {
145+
// 25% health pack
146+
else if roll < 73 {
151147
(LootType::RapidFireBoost, 15.0)
152148
}
153-
// 12% rapid fire boost (increased from 4%)
154-
else if roll < 82 {
149+
// 18% rapid fire boost
150+
else if roll < 85 {
155151
(LootType::BigBulletBoost, 15.0)
156152
}
157-
// 10% big bullet boost (increased from 3%)
158-
else if roll < 92 {
159-
// 10% chance of shield with varying HP (30-100 HP) (increased from 3%)
153+
// 12% big bullet boost
154+
else if roll < 93 {
155+
// 8% chance of shield with varying HP (30-100 HP)
160156
(LootType::Shield(gen_range(30, 101)), 15.0)
161157
} else {
162158
return None;
163159
}
164-
// 8% chance of nothing (decreased from 50%)
160+
// 7% chance of nothing
165161
} // LootSource::EnemyBoss => {
166162
// // Something always drops from the boss
167163
// (LootType::RareMetal(gen_range(10, 50)), 20.0)

0 commit comments

Comments
 (0)