mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2025-12-16 05:20:06 +01:00
This leads to code that is easier to understand and runs faster thanks to GDScript's typed instructions. The untyped declaration warning is now enabled on all projects where type hints were added. All projects currently run without any untyped declration warnings. Dodge the Creeps and Squash the Creeps demos intentionally don't use type hints to match the documentation, where type hints haven't been adopted yet (given its beginner focus).
27 lines
656 B
GDScript
27 lines
656 B
GDScript
extends Node3D
|
|
|
|
# NOTE: The code here just adds some control to our effects.
|
|
# Check `res://water_plane/water_plane.gd` for the real implementation.
|
|
|
|
var y := 0.0
|
|
|
|
@onready var water_plane: Area3D = $WaterPlane
|
|
|
|
func _ready() -> void:
|
|
$Container/RainSize/HSlider.value = $WaterPlane.rain_size
|
|
$Container/MouseSize/HSlider.value = $WaterPlane.mouse_size
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
if $Container/Rotate.button_pressed:
|
|
y += delta
|
|
water_plane.basis = Basis(Vector3.UP, y)
|
|
|
|
|
|
func _on_rain_size_changed(value: float) -> void:
|
|
$WaterPlane.rain_size = value
|
|
|
|
|
|
func _on_mouse_size_changed(value: float) -> void:
|
|
$WaterPlane.mouse_size = value
|