Skip to content

Commit fe042f1

Browse files
author
VexarCoding
committed
game: balance and debug improvements
- Increased starting money to 100 for better early game progression - Rebalanced tile processing intervals for better gameplay flow - Added debug logging for item animation system - Reorganized router tile processing logic - Updated tile pricing structure
1 parent edaa6b2 commit fe042f1

4 files changed

Lines changed: 51 additions & 35 deletions

File tree

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ fn setup_resources(mut commands: Commands) {
109109
tick_timer: Timer::from_seconds(TICK_LENGTH, TimerMode::Repeating),
110110
tick_count: 0,
111111
actions: Vec::new(),
112-
money: 30,
112+
money: 100,
113113
});
114114
commands.insert_resource(Hotkeys::default());
115115
}

src/resources.rs

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,7 @@ impl WorldRes {
148148
direction: conveyor.direction,
149149
item: conveyor.item,
150150
}
151-
} else if let Some(router) = tile.as_any().downcast_ref::<Router>() {
152-
SerializableTile::Router {
153-
position: router.position,
154-
direction: router.direction,
155-
item: router.item,
156-
last_output: router.last_output,
157-
}
151+
158152
} else if let Some(extractor) = tile.as_any().downcast_ref::<Extractor>() {
159153
SerializableTile::Extractor {
160154
position: extractor.position,
@@ -190,6 +184,13 @@ impl WorldRes {
190184
ticks: core.ticks,
191185
tile_id: core.tile_id,
192186
}
187+
} else if let Some(router) = tile.as_any().downcast_ref::<Router>() {
188+
SerializableTile::Router {
189+
position: router.position,
190+
direction: router.direction,
191+
item: router.item,
192+
last_output: router.last_output,
193+
}
193194
} else {
194195
SerializableTile::Conveyor {
195196
position: *pos,
@@ -249,17 +250,7 @@ impl WorldRes {
249250
direction,
250251
item,
251252
}),
252-
SerializableTile::Router {
253-
position,
254-
direction,
255-
item,
256-
last_output,
257-
} => Box::new(Router {
258-
position,
259-
direction,
260-
item,
261-
last_output,
262-
}),
253+
263254
SerializableTile::Extractor {
264255
position,
265256
direction,
@@ -300,6 +291,17 @@ impl WorldRes {
300291
inventory,
301292
}),
302293
SerializableTile::Portal { position, item } => Box::new(Portal { position, item }),
294+
SerializableTile::Router {
295+
position,
296+
direction,
297+
item,
298+
last_output,
299+
} => Box::new(Router {
300+
position,
301+
direction,
302+
item,
303+
last_output,
304+
}),
303305
SerializableTile::Junction {
304306
position,
305307
horizontal_item,

src/systems/items.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ pub fn spawn_animations(
4444
}
4545
}
4646
}
47+
println!("Initial empty_positions: {:?}", empty_positions);
48+
println!("Initial filled_positions: {:?}", filled_positions);
4749

4850
for action in &world.actions {
4951
match action {
@@ -67,6 +69,10 @@ pub fn spawn_animations(
6769
end.y as f32 * TILE_SIZE,
6870
1.0,
6971
);
72+
println!(
73+
"Spawning animation for item {:?} from {:?} to {:?}",
74+
item, start, end
75+
);
7076
commands.spawn((
7177
ItemAnimation {
7278
start_pos,
@@ -217,6 +223,11 @@ pub fn spawn_animations(
217223
},
218224
));
219225
}
226+
} else {
227+
println!(
228+
"Skipping animation for item {:?} from {:?} to {:?} due to conditions",
229+
item, start, end
230+
);
220231
}
221232
}
222233
}

src/utils.rs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,23 @@ pub fn get_tile_name(tile_type: (u8, u8)) -> String {
5757

5858
pub fn get_tile_core_interval(tile_type: (u8, u8)) -> u32 {
5959
match tile_type {
60-
(1, 2) => 50,
61-
(2, 1) => 10,
62-
(2, 2) => 15,
63-
(2, 3) => 15,
64-
(3, 1) => 20,
65-
(3, 2) => 20,
66-
(3, 3) => 20,
67-
(4, 1) => 30,
68-
(4, 2) => 30,
69-
(4, 3) => 35,
70-
(4, 4) => 40,
71-
(4, 5) => 40,
72-
(5, 1) => 25,
73-
(5, 2) => 25,
74-
(5, 3) => 25,
75-
_ => 60,
60+
(1, 2) => 100,
61+
(2, 1) => 20,
62+
(2, 2) => 30,
63+
(2, 3) => 30,
64+
65+
(3, 1) => 40,
66+
(3, 2) => 40,
67+
(3, 3) => 40,
68+
(4, 1) => 60,
69+
(4, 2) => 60,
70+
(4, 3) => 70,
71+
(4, 4) => 80,
72+
(4, 5) => 80,
73+
(5, 1) => 50,
74+
(5, 2) => 50,
75+
(5, 3) => 50,
76+
_ => 6942,
7677
}
7778
}
7879

@@ -82,6 +83,7 @@ pub fn get_tile_price(tile_type: (u8, u8)) -> u32 {
8283
(2, 1) => 10,
8384
(2, 2) => 15,
8485
(2, 3) => 15,
86+
8587
(3, 1) => 20,
8688
(3, 2) => 20,
8789
(3, 3) => 20,
@@ -136,6 +138,7 @@ pub fn get_new_tile(
136138
}) as Box<dyn Tile>,
137139
tile_type,
138140
),
141+
139142
(2, 3) => (
140143
Box::new(Junction {
141144
position,

0 commit comments

Comments
 (0)