gabraken commited on
Commit
aa65ffc
·
1 Parent(s): fdb51e7

Opposition

Browse files
backend/game/state.py CHANGED
@@ -166,8 +166,14 @@ class GameState(BaseModel):
166
  p1.recalculate_supply()
167
  state.players[player_id] = p1
168
 
169
- # Dummy opponent with no units to avoid win-condition triggering immediately
170
  dummy = PlayerState(player_id=TUTORIAL_DUMMY_ID, player_name="Training Ground")
 
 
 
 
 
 
171
  state.players[TUTORIAL_DUMMY_ID] = dummy
172
 
173
  return state
 
166
  p1.recalculate_supply()
167
  state.players[player_id] = p1
168
 
169
+ # Dummy opponent with two marines blocking the path to the objective
170
  dummy = PlayerState(player_id=TUTORIAL_DUMMY_ID, player_name="Training Ground")
171
+ for ex, ey in [(40.0, 50.0), (43.0, 54.0)]:
172
+ raw_x = max(0.5, min(_MAP_W - 0.5, ex))
173
+ raw_y = max(0.5, min(_MAP_H - 0.5, ey))
174
+ mx, my = snap_to_walkable(raw_x, raw_y)
175
+ enemy_marine = Unit.create(UnitType.MARINE, TUTORIAL_DUMMY_ID, mx, my)
176
+ dummy.units[enemy_marine.id] = enemy_marine
177
  state.players[TUTORIAL_DUMMY_ID] = dummy
178
 
179
  return state
frontend/src/lib/components/Map.svelte CHANGED
@@ -804,8 +804,9 @@
804
  {@const angle = rs?.angle ?? 0}
805
  {@const isSelected = u.id === $selectedUnit?.id}
806
  {@const isLargeUnit = u.unit_type === 'goliath' || u.unit_type === 'tank' || u.unit_type === 'wraith'}
807
- {@const spriteHalf = isLargeUnit ? 0.76 : 0.38}
808
- {@const spriteSize = isLargeUnit ? 1.52 : 0.76}
 
809
 
810
  <g transform="translate({rx},{ry})">
811
  <!-- Selection ring -->
 
804
  {@const angle = rs?.angle ?? 0}
805
  {@const isSelected = u.id === $selectedUnit?.id}
806
  {@const isLargeUnit = u.unit_type === 'goliath' || u.unit_type === 'tank' || u.unit_type === 'wraith'}
807
+ {@const isTank = u.unit_type === 'tank'}
808
+ {@const spriteHalf = isTank ? 1.52 : isLargeUnit ? 0.76 : 0.38}
809
+ {@const spriteSize = isTank ? 3.04 : isLargeUnit ? 1.52 : 0.76}
810
 
811
  <g transform="translate({rx},{ry})">
812
  <!-- Selection ring -->