main.gd: Kommentar zu dig_at richtigstellen, Autosave-Takt ableiten
Der Kommentar an dig_at sagte, der Kern prüfe alles außer der Abklingzeit. Das stimmt nicht: Der Kern prüft Abklingzeit, Feld, Gelände, Werkzeugstufe und freien Platz, aber nicht die Reichweite. Die prüft nur die Hülle (in _update_marker und _try_dig), weil die Figuren außerhalb des Gleichschritts laufen und der Kern ihren Ort nicht kennt. Der Plan für M1c darf sich nicht darauf verlassen. Der Kommentar nennt jetzt, was der Aufrufer und was der Kern prüft. AUTOSAVE_TICKS wiederholte mit 2400 die Taktrate von 20 pro Sekunde. Die Konstante wird jetzt als zwei Minuten aus GwSession.TICKS_PER_SECOND abgeleitet; GDScript nimmt das in einer const an und rechnet 2400. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ const PLAYER_NAME := "Spieler"
|
||||
## How far the pickaxe reaches, in tiles from the figure to the tile centre.
|
||||
const REACH_TILES := 2.5
|
||||
## Ticks between two automatic saves: two minutes.
|
||||
const AUTOSAVE_TICKS := 2400
|
||||
const AUTOSAVE_TICKS := 2 * 60 * GwSession.TICKS_PER_SECOND
|
||||
const CAMERA_ZOOM := Vector2(3.0, 3.0)
|
||||
|
||||
## Folder for the player key, the save and the recordings. Tests use their
|
||||
@@ -154,8 +154,10 @@ func _try_dig() -> void:
|
||||
dig_at(marker.tile)
|
||||
|
||||
|
||||
## Queues a pickaxe hit on `tile`, at most once per cooldown. The core checks
|
||||
## everything else.
|
||||
## Queues a pickaxe hit on `tile`, at most once per cooldown. The caller must
|
||||
## check the reach: figures move outside the lockstep, so the core does not
|
||||
## know where the figure is. The core checks the cooldown, the tile, its
|
||||
## terrain, the tool tier and the free space in the inventory.
|
||||
func dig_at(tile: Vector2i) -> void:
|
||||
if session.tick() < _next_dig_tick:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user