Update most demos for Godot 4.0.beta10 (#782)

This commit is contained in:
Hugo Locurcio
2023-01-05 16:50:17 +01:00
committed by GitHub
parent 85ca2fb2a1
commit 1d5184e235
758 changed files with 24258 additions and 9624 deletions

21
2d/glow/beach_cave.gd Normal file
View File

@@ -0,0 +1,21 @@
extends Node2D
const CAVE_LIMIT = 1000
var glow_map = preload("res://glow_map.webp")
@onready var cave = $Cave
func _unhandled_input(event):
if event is InputEventMouseMotion and event.button_mask > 0:
cave.position.x = clampf(cave.position.x + event.relative.x, -CAVE_LIMIT, 0)
if event.is_action_pressed("toggle_glow_map"):
if $WorldEnvironment.environment.glow_map:
$WorldEnvironment.environment.glow_map = null
# Restore glow intensity to its default value
$WorldEnvironment.environment.glow_intensity = 0.8
else:
$WorldEnvironment.environment.glow_map = glow_map
# Increase glow intensity to compensate for the glow map darkening parts of the glow.
$WorldEnvironment.environment.glow_intensity = 1.6