Stacking distorders, menu layouts, lab rewards, enemy detail, artillery cross
DISTORDER STACKING. Each space-time distorder vessel past the first raises the fleet's speed ceiling by 1.0, so a second one is worth crewing instead of being dead weight. GameState gains max_fleet_speed_multiplier, pushed by Fleet whenever composition changes - the same direction as every other fleet-derived figure, since GameState does not reach into the scene tree to count ships. The energy drain is normalised against the CURRENT ceiling, so full boost costs the same per second however wide it is: extra vessels buy more speed, not cheaper speed. Losing one re-clamps an over-ceiling boost rather than leaving the fleet travelling faster than its crew can sustain. TRANSFER MENU. Rows overlapped, and the last one ran into the hint text. row_height is divided from the available space, but each row's contents used a fixed pixel ladder - glyph at +10, buttons at +88, selector at +142 - which needs about 244px. Three resources fit; the fourth cut rows to 180 and every one spilled 64px into the next. Every offset is now a fraction of the row, so it cannot overflow. Also dropped the per-row AMOUNT caption (four copies of a word the footer hint already explains) and moved each glyph and name to the TOP of its row, where they read as its heading rather than the next row's. HANGAR. Six vessel types in one row gave each about 100px for a 155px label, so the names ran together. Now a 3x2 grid per section, sized from the space between the first heading and the status line, using the empty lower half. LAB RESEARCH REWARD. A harder enemy lab is worth more research points, and how hard a lab is depends on the layout authored for it - how many capture points, how many defenders - which the planet TYPE cannot know. PlanetSetup carries research_point_reward, set in the map editor, overriding the planet type's flat rate. 0 means "no opinion", so every map authored before this keeps its old value. RESEARCH LAB BACKGROUND. Its own shader instead of the crater field with a red tint, which read as "rocky planet, tinted" rather than someone's facility: plated floor, seams, service conduits, lit junctions. Loop-free by construction (#68's lesson applied up front) - conduits stay continuous across cells by keying a horizontal run to cell.y and a vertical to cell.x, so neighbouring cells agree without any cell scanning its neighbours. ENEMY DETAIL. Every enemy was a single flat outline, which left the artillery and the turret spawner as the same octagon at two sizes - the silhouette carried no information about what the thing did. EnemyDefinition gains detail_lines and detail_rings as DATA, so adding an enemy still means adding a definition rather than editing Enemy.gd, and the four non-default hulls are redrawn: a long-barrelled sniper, a squat mortar, a hive with launch bays, a capital ship with spine and ribs. Three things drew an enemy from its definition - the enemy, the map editor's markers, and the palette buttons - each reimplementing it from hull_points alone, so the new detail appeared in the game and nowhere else and an editor marker stopped matching what it placed. They now share EnemyDefinitions.draw_definition(). ARTILLERY. The 1.8s charge-up before the tower fired arrived long before the threat was legible and mostly read as the tower being stuck. It fires immediately now; the warning is the shell you can see in the air plus a small cross on the ground at the impact point. Deliberately not a blast-radius ring - a large translucent area was easy to read as the explosion having already happened, where the cross says "move off this spot". MAIN MENU. No Quit in any build (a web build has nothing to quit to, and Android's back gesture already does it), a plain black background, and the game is "Spaceship" - in the title and in config/name, which is what drives the browser tab for the web export. change_scene_to_file() returns an error and otherwise fails silently, leaving the menu up, which is indistinguishable from an unpressed button; it is now checked and reported on screen. Full suite green at 99/99. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
a3c6316676
commit
7817d1ffc6
48 changed files with 897 additions and 159 deletions
28
MainMenu.gd
28
MainMenu.gd
|
|
@ -3,8 +3,10 @@ extends Node2D
|
|||
# The menu stacks whatever entries are actually available, rather than
|
||||
# trusting the positions authored in the scene.
|
||||
#
|
||||
# Two of the four entries only exist when the game is run from Godot, so a
|
||||
# shipped build shows a two-entry menu and an editor run shows four. Fixed
|
||||
# Two of the three entries only exist when the game is run from Godot, so a
|
||||
# shipped build shows one entry and an editor run shows three. There is no
|
||||
# Quit: a web build has nothing to quit TO, and on Android the system back
|
||||
# gesture already does it. Fixed
|
||||
# offsets would leave holes where the hidden entries used to be - the same
|
||||
# failure the HUD's button columns had, where a literal y meant "below the
|
||||
# thing above me" and stopped being true when that thing moved. Here the
|
||||
|
|
@ -28,8 +30,6 @@ const STATUS_HEIGHT: float = 70.0
|
|||
@onready var editor_label: Label = $UI/EditorLabel
|
||||
@onready var dev_button: IconButton = $UI/DevModeButton
|
||||
@onready var dev_label: Label = $UI/DevModeLabel
|
||||
@onready var quit_button: IconButton = $UI/QuitButton
|
||||
@onready var quit_label: Label = $UI/QuitLabel
|
||||
@onready var status_label: Label = $UI/StatusLabel
|
||||
|
||||
|
||||
|
|
@ -39,8 +39,6 @@ func _ready() -> void:
|
|||
editor_button.enabled = true
|
||||
dev_button.pressed.connect(_on_dev_mode_pressed)
|
||||
dev_button.enabled = true
|
||||
quit_button.pressed.connect(_on_quit_pressed)
|
||||
quit_button.visible = not OS.has_feature("web")
|
||||
|
||||
# Dev mode and the map editor are development tools, not features of the
|
||||
# game: they are for building and play-testing it, and a player who
|
||||
|
|
@ -65,7 +63,7 @@ func is_developer_build() -> bool:
|
|||
func _layout_stack() -> void:
|
||||
var rows: Array = []
|
||||
for row in [[play_button, play_label], [editor_button, editor_label],
|
||||
[dev_button, dev_label], [quit_button, quit_label]]:
|
||||
[dev_button, dev_label]]:
|
||||
if row[0].visible:
|
||||
rows.append(row)
|
||||
if rows.is_empty():
|
||||
|
|
@ -93,7 +91,17 @@ func _layout_stack() -> void:
|
|||
|
||||
func _on_play_pressed() -> void:
|
||||
GameState.reset_new_game()
|
||||
get_tree().change_scene_to_file("res://Main.tscn")
|
||||
_start("res://Main.tscn")
|
||||
|
||||
|
||||
# change_scene_to_file() returns an error and otherwise fails SILENTLY - the
|
||||
# menu simply stays up, which is indistinguishable from the button not having
|
||||
# been pressed at all. Reporting it turns "nothing happens" into something a
|
||||
# player can read back.
|
||||
func _start(scene_path: String) -> void:
|
||||
var result: int = get_tree().change_scene_to_file(scene_path)
|
||||
if result != OK:
|
||||
status_label.text = "Could not start (%s, error %d)" % [scene_path.get_file(), result]
|
||||
|
||||
|
||||
func _on_dev_mode_pressed() -> void:
|
||||
|
|
@ -110,10 +118,8 @@ func _on_editor_pressed() -> void:
|
|||
status_label.text = "Map editor only runs from Godot"
|
||||
return
|
||||
if editor_button.enabled:
|
||||
get_tree().change_scene_to_file("res://PlanetSetupEditor.tscn")
|
||||
_start("res://PlanetSetupEditor.tscn")
|
||||
return
|
||||
status_label.text = "Map editor coming soon"
|
||||
|
||||
|
||||
func _on_quit_pressed() -> void:
|
||||
get_tree().quit()
|
||||
|
|
|
|||
Loading…
Reference in a new issue