aboutsummaryrefslogtreecommitdiffstats
path: root/src/server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/server.rs b/src/server.rs
index 0a5e4cf..f426b38 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -112,14 +112,16 @@ impl Plugin for ServerPlugin {
}
}
+const TOWER_DISTANCE: f32 = 400.;
+
fn setup(mut commands: Commands, mut entity_map: ResMut<EntityMap>) {
let [blue_tower_1, blue_tower_2, blue_tower_3, blue_nexus, red_tower_1, red_tower_2, red_tower_3, red_nexus] =
generate_client_ids::<8>(&entity_map).into();
- for (n, client_id) in [(1, blue_tower_1), (2, blue_tower_2), (3, blue_tower_3)].iter() {
+ for (n, client_id) in [(0, blue_tower_1), (1, blue_tower_2), (2, blue_tower_3)].iter() {
let entity = commands.spawn(TowerBundle::new(
*client_id,
- Vec2::new(0., *n as f32 * 250.),
+ Vec2::new(0., TOWER_DISTANCE / 2. + *n as f32 * TOWER_DISTANCE),
Faction::Blue,
));
entity_map.0.insert(*client_id, entity.id());
@@ -128,16 +130,16 @@ fn setup(mut commands: Commands, mut entity_map: ResMut<EntityMap>) {
let client_id = blue_nexus;
let entity = commands.spawn(NexusBundle::new(
client_id,
- Vec2::new(0., 1000.0),
+ Vec2::new(0., TOWER_DISTANCE / 2. + 3. * TOWER_DISTANCE),
Faction::Blue,
));
entity_map.0.insert(client_id, entity.id());
}
- for (n, client_id) in [(1, red_tower_1), (2, red_tower_2), (3, red_tower_3)].iter() {
+ for (n, client_id) in [(0, red_tower_1), (1, red_tower_2), (2, red_tower_3)].iter() {
let entity = commands.spawn(TowerBundle::new(
*client_id,
- Vec2::new(0., *n as f32 * -250.),
+ Vec2::new(0., -TOWER_DISTANCE / 2. - *n as f32 * TOWER_DISTANCE),
Faction::Red,
));
entity_map.0.insert(*client_id, entity.id());
@@ -146,7 +148,7 @@ fn setup(mut commands: Commands, mut entity_map: ResMut<EntityMap>) {
let client_id = red_nexus;
let entity = commands.spawn(NexusBundle::new(
client_id,
- Vec2::new(0., -1000.0),
+ Vec2::new(0., -TOWER_DISTANCE / 2. - 3. * TOWER_DISTANCE),
Faction::Red,
));
entity_map.0.insert(client_id, entity.id());