Computer controls #80

Closed
opened 2026-08-21 15:19:50 +00:00 by metaheavens · 1 comment
Owner

On computer aiming the default shot should be done with the mouse and left click. to use special abilities, use numbers to select the weapon type (1 default, 2 gas bomb ...)

On computer aiming the default shot should be done with the mouse and left click. to use special abilities, use numbers to select the weapon type (1 default, 2 gas bomb ...)
Author
Owner

Done in baac11a, live at https://metaheavens.de/spaceship/

The mouse aims, the left button fires, and the number keys pick the weapon - 1 the fleet's guns, 2 the gas bomb, 3 the laser.

The pointer path hands its heading to FireStickController rather than driving weapons itself, so exactly one thing in the scene aims a gun. A held stick wins over the mouse: a finger on it is a deliberate act, a mouse resting somewhere is not. Abilities gained fire_at(), which aims and fires in one call rather than pretending to be a press-drag-release touch.

The weapon numbering resolves controllers by name in a fixed order, so "2" is the gas bomb in every scene - discovering them by scanning children would tie the number keys to scene node order, which is not something a player can see or rely on.

It is gated on the absence of a touchscreen, because Godot emulates a mouse button from every touch and without that guard a tap on a phone would fire the guns. The gate has an explicit override, and not for tidiness: headless reports a touchscreen, so with the automatic answer alone the aiming could never be exercised by a test and the only covered behaviour would be the guard itself.

Done in baac11a, live at https://metaheavens.de/spaceship/ The mouse aims, the left button fires, and the number keys pick the weapon - **1** the fleet's guns, **2** the gas bomb, **3** the laser. The pointer path hands its heading to `FireStickController` rather than driving weapons itself, so exactly one thing in the scene aims a gun. A held stick wins over the mouse: a finger on it is a deliberate act, a mouse resting somewhere is not. Abilities gained `fire_at()`, which aims and fires in one call rather than pretending to be a press-drag-release touch. The weapon numbering resolves controllers **by name in a fixed order**, so "2" is the gas bomb in every scene - discovering them by scanning children would tie the number keys to scene node order, which is not something a player can see or rely on. It is gated on the absence of a touchscreen, because Godot emulates a mouse button from every touch and without that guard a tap on a phone would fire the guns. The gate has an explicit override, and not for tidiness: headless *reports* a touchscreen, so with the automatic answer alone the aiming could never be exercised by a test and the only covered behaviour would be the guard itself.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
metaheavens/spaceship#80
No description provided.