27 lines
557 B
GDScript3
27 lines
557 B
GDScript3
extends OmniLight
|
|
|
|
|
|
# Declare member variables here. Examples:
|
|
# var a = 2
|
|
# var b = "text"
|
|
|
|
var _noise = OpenSimplexNoise.new()
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
randomize()
|
|
# Configure the OpenSimplexNoise instance.
|
|
_noise.seed = randi()
|
|
_noise.octaves = 4
|
|
_noise.period = 20.0
|
|
_noise.persistence = 0.8
|
|
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
if(OS.get_ticks_msec()%100<10):
|
|
light_energy = 1 + _noise.get_noise_1d(OS.get_ticks_msec())
|
|
|