Initial commit

This commit is contained in:
2026-01-21 23:51:53 +01:00
commit 60b208fee0
1703 changed files with 100223 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
extends BasicRoom
class_name ControlRoom
@onready var steeringMinigame = $Monitor/SubViewport/SteeringMinigame
@onready var lightswitch = $LightSwitch/ButtonLogicToggleLightswitch
@onready var switchPivot = $LightSwitch/SwitchPivot
@onready var light = $OmniLight3D
@export var controllStick: Node3D
@export var shipConditionDisplayNumber: int = 100
@onready var shipConditionNumberLabel = $Monitor_001/SubViewport2/Control/ShipConditionNumber
@onready var shipConditionNumberLabelSettings = shipConditionNumberLabel.label_settings
func _ready() -> void:
if controllStick:
controllStick.get_child(0).onPressed.connect(controllLeverPressed)
steeringMinigame.collision.connect(onAstroidCollision)
steeringMinigame.controllStick = controllStick
func _process(_delta: float) -> void:
if shipConditionNumberLabel.label_settings:
if shipConditionDisplayNumber >70:
shipConditionNumberLabelSettings.font_color = Color.GREEN
elif shipConditionDisplayNumber <=30:
shipConditionNumberLabelSettings.font_color = Color.RED
else:
shipConditionNumberLabelSettings.font_color = Color.YELLOW
if lightswitch.state:
switchPivot.rotation.x = deg_to_rad(0)
else:
switchPivot.rotation.x = deg_to_rad(17)
if SpaceshipLogicRef:
if SpaceshipLogicRef.power:
light.visible = lightswitch.state
else:
light.visible = SpaceshipLogicRef.power
else:
return
if !SpaceshipLogicRef.shipFuel:
steeringMinigame.active = false
shipConditionNumberLabel.text = str(shipConditionDisplayNumber) + "%"
func controllLeverPressed():
steeringMinigame.activate()
func onAstroidCollision():
if SpaceshipLogicRef:
SpaceshipLogicRef.collisionWithAstroid()

View File

@@ -0,0 +1 @@
uid://dp4rakv0drj1f

View File

@@ -0,0 +1,13 @@
# WebSocket Multiplayer
This is a sample showing how the use WebSockets along with the Multiplayer API in Godot.
Language: GDScript
Renderer: Compatibility
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/540
## Screenshots
![Screenshot](screenshots/screenshot.png)