first commit

This commit is contained in:
2025-02-16 14:28:47 +01:00
commit f1f0ae6ce1
63 changed files with 4018 additions and 0 deletions

25
Droplet.gd Normal file
View File

@@ -0,0 +1,25 @@
extends Area2D
@onready var sprite: Sprite2D = $sprite
@onready var splash: CPUParticles2D = $splash
var linear_velocity := Vector2.ZERO
var _p0 := Vector2.ZERO
func _ready() -> void:
_p0 = position
rotation = linear_velocity.angle() - .5 * PI
func _physics_process(dt: float) -> void:
linear_velocity.y += 1000.0 * dt
rotation = linear_velocity.angle() - .5 * PI
position += linear_velocity * dt
if position.y > 2048:
queue_free()
func _on_area_entered(_area: Area2D) -> void:
linear_velocity = Vector2.ZERO
set_physics_process(false)
sprite.visible = false
splash.amount = 2 + int(roundf(2.0 * randf()))
splash.emitting = true
get_tree().create_timer(splash.lifetime).timeout.connect(queue_free)