sun.gd 393 B

1234567891011121314
  1. extends Area2D
  2. var faction = Factions.UNATACKABLE
  3. func _process(delta):
  4. # Increase temperature of objects too close to the sun
  5. for body in get_overlapping_bodies():
  6. if (body.has_meta("temp")):
  7. body.temp += delta*10000000.0*get_node("/root/Main").sun_scale/max(body.global_position.distance_to(get_parent().global_position),10000.0)/sqrt(body.mass)
  8. func _ready():
  9. set_process(true)