A11: Chart, minimap and tide forecast
The island as a hand-drawn nautical chart: paper land with ink contours every 5 m (heavier every 25 m) and a coastline, the sea in the sea's ink, place names drawn from the seed, the barge's route, and the player's mark. The land the coming tide will flood is hatched, and land the sea has already taken is washed with the sea, so the forecast isn't told by colour alone. - Flood.forecast(level, structures): a copy of the flood spread to a level as update() would, with today's breakwaters. Changes nothing. - ChartMap: FULL (opened and closed with the new "map" binding, M) and MINI (240 m around the player, top left, during the drop and play). The paper is drawn once per world (about 270 ms) and shared; the forecast overlay is redrawn at most once a second, and only when the forecast level, the flood or the pieces changed. - PlaceNames: names from original coastal words and a word for each kind of place, the same for every player of a match. - make chart-captures renders the chart before and after the first tide. Solo matches have no teammates; ChartMap draws `mates` when duos (M7) give it some. Closes #51 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
## Capture scenario for the chart (A11): an island's full chart and minimap over the
|
||||
## menu backdrop, with a player marked. Stages: "first" (the first tide is forecast) and
|
||||
## "later" (the first tide has risen and the second is forecast, so taken land shows
|
||||
## washed with the sea and the next is hatched).
|
||||
extends Control
|
||||
|
||||
@export var stage: String = "first"
|
||||
@export var match_seed: int = 2
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
var backdrop: ColorRect = ColorRect.new()
|
||||
backdrop.color = Palette.SEA_INK.darkened(0.4)
|
||||
backdrop.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||
add_child(backdrop)
|
||||
var sim: Simulation = Simulation.new(match_seed)
|
||||
sim.start_tide()
|
||||
if stage == "later":
|
||||
var first: Dictionary = Tuning.TIDE_PHASES[0]
|
||||
var into: int = roundi((float(first["hold"]) + float(first["rise"])) * Tuning.TICK_RATE_HZ) + 5 * Tuning.TICK_RATE_HZ
|
||||
sim.tide = Tide.new(sim.tick - into, sim.tide.levels)
|
||||
sim.set_sea_level(sim.tide.level_at(sim.tick))
|
||||
var drop: Drop = Drop.plan(sim.ground, SimRng.new(match_seed), 0)
|
||||
var top: Vector3 = sim.island.summits[0]
|
||||
var me: Vector3 = top + Vector3(-30.0, 0.0, 40.0)
|
||||
var chart: ChartMap = ChartMap.new(ChartMap.Mode.FULL)
|
||||
chart.position = Vector2(560.0, 50.0)
|
||||
chart.size = Vector2(620.0, 620.0)
|
||||
add_child(chart)
|
||||
chart.setup(sim, match_seed, drop)
|
||||
chart.refresh(me, deg_to_rad(40.0), true, 10.0)
|
||||
var mini: ChartMap = ChartMap.new(ChartMap.Mode.MINI)
|
||||
mini.position = Vector2(60.0, 60.0)
|
||||
mini.size = Vector2(170.0, 170.0)
|
||||
add_child(mini)
|
||||
mini.setup(sim, match_seed, drop, chart)
|
||||
mini.refresh(me, deg_to_rad(40.0), true, 10.0)
|
||||
Reference in New Issue
Block a user