ci-platforms / windows amd64 smoke (push) Skipped
ci / release (push) Successful in 8m58s
ci-platforms / darwin amd64 smoke (push) Skipped
ci-platforms / darwin arm64 smoke (push) Skipped
ci / checks (push) Successful in 4m46s
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 13m28s
38 lines
878 B
Plaintext
38 lines
878 B
Plaintext
package lightingdemo
|
|
|
|
import (
|
|
"aego/input"
|
|
"aego/lighting"
|
|
)
|
|
|
|
// This script only moves the player's light anchor and changes the development
|
|
// view. It never changes the player, collision state, material or gameplay RNG.
|
|
script Flashlight {
|
|
@export
|
|
var Player NodeRef
|
|
|
|
func Update(dt float) {
|
|
if Player != nil && Player.IsAlive() {
|
|
if Player.Get<SpriteRenderer>().FlipX {
|
|
node.SetPosition(Vec2{-0.18, -0.15})
|
|
node.SetRotation(3.1415927)
|
|
} else {
|
|
node.SetPosition(Vec2{0.18, -0.15})
|
|
node.SetRotation(0)
|
|
}
|
|
}
|
|
if input.Pressed("LightingToggle") {
|
|
lighting.SetEnabled(!lighting.Enabled())
|
|
}
|
|
if input.Pressed("LightingDebug") {
|
|
if lighting.Debug() == "lighting" {
|
|
lighting.SetDebug("normals")
|
|
} else if lighting.Debug() == "normals" {
|
|
lighting.SetDebug("shadows")
|
|
} else {
|
|
lighting.SetDebug("lighting")
|
|
}
|
|
}
|
|
}
|
|
}
|