Make F5 incremental and reduce iron maiden geometry, physics and idle updates
This commit is contained in:
@@ -6,6 +6,7 @@ var ropes=[]
|
||||
var heat_materials=[]
|
||||
var heat_light: OmniLight3D
|
||||
var heat=0.0
|
||||
var applied_heat=-1.0
|
||||
var tension=0.0
|
||||
var submerged=false
|
||||
var splash_count=0
|
||||
@@ -57,6 +58,17 @@ func setup(game,development):
|
||||
|
||||
func reset():
|
||||
tension=0;heat=0;submerged=false
|
||||
if d.selected==3:apply_heat()
|
||||
|
||||
func apply_heat():
|
||||
if is_equal_approx(heat,applied_heat):return
|
||||
applied_heat=heat
|
||||
for mat in heat_materials:mat.set_shader_parameter("heat",heat)
|
||||
heat_light.visible=heat>.001
|
||||
if d.device.get_meta("apparatus_model","")=="iron_maiden_v01":
|
||||
heat_light.light_color=Color("ff2510").lerp(Color("ffad48"),smoothstep(.55,1.0,heat))
|
||||
heat_light.light_energy=pow(heat,1.5)*3.2
|
||||
else:heat_light.light_energy=heat*0.9
|
||||
|
||||
func update(dt,active):
|
||||
var i=g.index_of(g.working)
|
||||
@@ -88,8 +100,4 @@ func update(dt,active):
|
||||
var target=clampf(d.elapsed/3.0,0,1) if i>=0 and d.stage>0 else 0.0
|
||||
if d.release_clock>0:target=heat
|
||||
heat=move_toward(heat,target,dt*(1.5 if target>heat else 0.3))
|
||||
for mat in heat_materials:mat.set_shader_parameter("heat",heat)
|
||||
if d.device.get_meta("apparatus_model","")=="iron_maiden_v01":
|
||||
heat_light.light_color=Color("ff2510").lerp(Color("ffad48"),smoothstep(.55,1.0,heat))
|
||||
heat_light.light_energy=pow(heat,1.5)*3.2
|
||||
else:heat_light.light_energy=heat*0.9
|
||||
apply_heat()
|
||||
|
||||
Reference in New Issue
Block a user