Skip to content

Commit e45b425

Browse files
committed
Minor updates
1 parent ffed3c7 commit e45b425

3 files changed

Lines changed: 41 additions & 19 deletions

File tree

README.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,33 @@
1313
## Features
1414

1515
- **Mission-Based Gameplay**: Complete objectives across multiple levels with increasing difficulty
16+
- **Difficulty System**: Choose from three difficulty levels (Nebula/Easy, Supernova/Normal, BlackHole/Hard)
17+
- Difficulty affects enemy spawn rates, damage taken, and loot drop chances
1618
- **Classic Space Shooter Controls**: Rotate and thrust your ship with smooth engine mechanics
1719
- **Asteroid Destruction**: Break large asteroids into smaller fragments, with rare asteroids dropping valuable loot
1820
- **Enemy Ships**: Battle enemy ships that track and shoot at you
21+
- **Bullet-to-Bullet Collisions**: Your bullets can intercept and destroy enemy bullets, creating defensive gameplay
22+
- **Pause System**: Pause the game at any time with ESC key
1923
- **Loot System**: Collect scrap, rare metals, health packs, weapon boosts, and shields
2024
- **Magnet Effect**: Loot items are automatically attracted to your ship when nearby
2125
- **Animated Loot**: Items rotate and drift realistically in space
2226
- **Shield System**: Activate shields that absorb damage before it reaches your health
2327
- **Weapon Boosts**: Rapid fire mode and big bullet mode for enhanced firepower
2428
- **Resource Management**: Track rust piles (scrap) and gold (rare metals) separately
25-
- **Health Point System**: Start with 100 HP - bigger asteroids deal more damage!
26-
- **Shield System**: Collect shield items to activate temporary shields that absorb damage
29+
- **Health Point System**: Start with 150 HP - bigger asteroids deal more damage!
30+
- **Health Restoration**: Health is fully restored to 150 HP at the start of each mission
2731
- **Variable Damage**: Damage scales with asteroid size and bullet type
28-
- **Enemy Health System**: Enemies have 30 HP and take multiple hits to destroy
32+
- **Enemy Health System**: Enemies have 24 HP and take multiple hits to destroy
2933
- **High Score System**: Your high score is automatically saved and persists between sessions
3034

3135
## Controls
3236

33-
- **Left Arrow**: Rotate ship counter-clockwise
34-
- **Right Arrow**: Rotate ship clockwise
37+
- **Left Arrow**: Rotate ship counter-clockwise / Select difficulty (in menu)
38+
- **Right Arrow**: Rotate ship clockwise / Select difficulty (in menu)
3539
- **Up Arrow**: Thrust forward (with smooth engine ramp-up)
3640
- **Space**: Shoot bullets / Launch mission (from briefing screen)
3741
- **Enter**: Start game (from menu) / Next mission (from success screen) / Return to menu (from game over screen)
42+
- **ESC**: Pause/Resume game (during gameplay)
3843

3944
## Installation
4045

@@ -86,17 +91,23 @@ The pre-commit hook automatically runs the same checks as CI before each commit.
8691
### Mission System
8792

8893
The game features a mission-based progression system:
94+
- **Difficulty Selection**: Choose your difficulty level before starting (Nebula/Easy, Supernova/Normal, BlackHole/Hard)
95+
- **Nebula (Easy)**: 0.8x damage taken, slower enemy spawns, +10% loot luck
96+
- **Supernova (Normal)**: 1.0x damage taken, normal spawns, standard loot
97+
- **BlackHole (Hard)**: 1.5x damage taken, faster enemy spawns, -15% loot luck
8998
- **Briefing Screen**: View mission objectives before launching
9099
- **Mission Objectives**: Each mission requires completing specific goals:
91100
- Destroy a certain number of enemies
92101
- Collect a certain amount of rust piles (scrap)
93102
- Collect a certain amount of gold (rare metals)
94103
- **Mission Success**: Complete all objectives to progress to the next level
95104
- **Progressive Difficulty**: Missions become increasingly challenging with more enemies and asteroids
105+
- **Health Restoration**: Your health is fully restored to 150 HP at the start of each new mission
106+
- **State Persistence**: Resources (scrap, gold), active shields, and weapon boosts persist between missions
96107

97108
### Scoring
98109
- **Asteroids**: 100 points each
99-
- **Enemy Ships**: 300 points each (10 points per HP, enemies have 30 HP)
110+
- **Enemy Ships**: 240 points each (10 points per HP, enemies have 24 HP)
100111

101112
### Loot System
102113

@@ -135,31 +146,42 @@ Loot items drop from destroyed asteroids and enemies:
135146

136147
### Gameplay
137148

138-
- **Health System**: Start with 100 HP (displayed as HP: current/max)
149+
- **Health System**: Start with 150 HP (displayed as HP: current/max)
150+
- **Health Restoration**: Health is fully restored to 150 HP at the start of each new mission
139151
- **Shield System**:
140152
- Shields absorb damage before it reaches your health
141153
- Shield HP is displayed when active: "SHIELD: current/max"
142154
- Shields have a duration (30 seconds) and deactivate when HP reaches 0 or timer expires
143155
- Damage is first applied to shield, then to health if shield is depleted
156+
- Active shields persist between missions
144157
- **Damage System**:
145158
- **Asteroid Collisions**: Damage scales with asteroid size (bigger asteroids = more damage)
146159
- Base damage: 5 HP per 10 units of radius
147160
- Large asteroids (radius 40): ~20 HP damage
148161
- Medium fragments (radius 20): ~10 HP damage
149162
- Small fragments (radius 10): ~5 HP damage
150-
- **Enemy Bullets**: Deal 15 HP damage
163+
- Damage is multiplied by difficulty level (Easy: 0.8x, Normal: 1.0x, Hard: 1.5x)
164+
- **Enemy Bullets**: Deal 15 HP damage (multiplied by difficulty)
151165
- **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
166+
- **Enemy Health**: Enemies have 24 HP and take multiple hits to destroy
167+
- **Bullet-to-Bullet Collisions**: Your bullets can intercept and destroy enemy bullets
168+
- When player and enemy bullets collide, both are destroyed
169+
- Creates an explosion effect at the collision point
170+
- Provides defensive gameplay - shoot enemy bullets to protect yourself
171+
- **Pause System**: Press ESC to pause the game at any time
172+
- Game state is frozen while paused
173+
- Press ESC again to resume
153174
- Complete mission objectives to progress (kills, rust piles, and gold)
154175
- Destroy asteroids to break them into smaller pieces
155176
- Rare asteroids (10% spawn chance) have distinct appearance and always drop loot
156-
- Enemy ships spawn based on mission configuration and track your position
157-
- Enemies have 30 HP and shoot at you - destroy them to complete kill objectives
177+
- Enemy ships spawn based on mission configuration and difficulty level
178+
- Enemies track your position and shoot at you - destroy them to complete kill objectives
158179
- Collect rust piles and gold separately - missions require specific amounts of each
159-
- Health packs restore 25 HP (capped at maximum of 100 HP)
180+
- Health packs restore 25 HP (capped at maximum of 150 HP)
160181
- **Rapid Fire Boost**: Reduces shooting cooldown by 3x for 10 seconds
161-
- **Big Bullet Boost**: Shoots larger, more powerful bullets (20 damage) for 15 seconds
182+
- **Big Bullet Boost**: Shoots larger, more powerful bullets (30 damage vs 15) for 15 seconds
162183
- **Shield**: Activates a temporary shield that absorbs damage before it reaches your health
184+
- **State Persistence**: Resources (scrap, gold), active shields, and weapon boost timers persist between missions
163185
- When HP reaches 0, your score is saved if it's a new high score
164186

165187
## Project Structure

src/components.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl EnemyShip {
161161
};
162162
let y = gen_range(50.0, screen_height() - 50.0);
163163
let speed_x = if side == 0 { 120.0 } else { -120.0 }; // Use constant or number
164-
let max_health = 30.0;
164+
let max_health = 24.0;
165165
Self {
166166
pos: vec2(x, y),
167167
vel: vec2(speed_x, gen_range(-20.0, 20.0)),
@@ -308,9 +308,9 @@ impl Difficulty {
308308
// Negative means less chances
309309
pub fn loot_luck_modifier(&self) -> i32 {
310310
match self {
311-
Difficulty::Nebula => 10, // +10% к удаче
311+
Difficulty::Nebula => 10, // +10% to luck
312312
Difficulty::Supernova => 0,
313-
Difficulty::BlackHole => -15, // -15% к удаче
313+
Difficulty::BlackHole => -15, // -15% to luck
314314
}
315315
}
316316
}

src/game.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl Game {
8888
self.ship.vel = vec2(0.0, 0.0);
8989
self.ship.rotation = 0.0;
9090
self.ship.engine.current_thrust = 0.0;
91-
// Restore health to 100%
91+
// Restore health to 100% (150 HP)
9292
self.ship.health = self.ship.max_health;
9393
// Note: scrap, rare_metal, shield state, and boost timers are preserved between missions
9494
}
@@ -118,8 +118,8 @@ pub fn create_ship() -> Ship {
118118
pos: vec2(screen_width() / 2.0, screen_height() / 2.0),
119119
vel: vec2(0.0, 0.0),
120120
rotation: 0.0,
121-
health: 100.0,
122-
max_health: 100.0,
121+
health: 150.0,
122+
max_health: 150.0,
123123
shoot_timer: 0.0,
124124
rapid_fire_timer: 0.0,
125125
engine: Engine::basic(),

0 commit comments

Comments
 (0)