Difference between revisions of "Oolite JavaScript Reference: Sun"

From Elite Wiki
m (Updated for 1.74.)
(Fixed dangling small)
Line 1: Line 1:
 
<small>'''Prototype:''' <code>[[Oolite JavaScript Reference: Entity|Entity]]</code></small><br />
 
<small>'''Prototype:''' <code>[[Oolite JavaScript Reference: Entity|Entity]]</code></small><br />
<small>'''Subtypes:''' none
+
<small>'''Subtypes:''' none</small>
  
 
The '''<code>Sun</code>''' class is an <code>[[Oolite JavaScript Reference: Entity|Entity]]</code> representing a sun. A <code>Sun</code> has all the properties and methods of a <code>Entity</code>, and several others. Currently, Oolite supports at most one sun per system, accessible via the <code>[[Oolite JavaScript Reference: System|system]].[[Oolite JavaScript Reference: System#sun|sun]]</code> property.
 
The '''<code>Sun</code>''' class is an <code>[[Oolite JavaScript Reference: Entity|Entity]]</code> representing a sun. A <code>Sun</code> has all the properties and methods of a <code>Entity</code>, and several others. Currently, Oolite supports at most one sun per system, accessible via the <code>[[Oolite JavaScript Reference: System|system]].[[Oolite JavaScript Reference: System#sun|sun]]</code> property.

Revision as of 08:57, 28 June 2010

Prototype: Entity
Subtypes: none

The Sun class is an Entity representing a sun. A Sun has all the properties and methods of a Entity, and several others. Currently, Oolite supports at most one sun per system, accessible via the system.sun property.

Properties

hasGoneNova

hasGoneNova : Boolean (read-only)

True if the sun has gone nova.

See Also: isGoingNova, goNova()

isGoingNova

isGoingNova : Boolean (read-only)

True if the sun is scheduled to go nova.

See Also: hasGoneNova, goNova(), cancelNova()

radius

radius : Number (read-only)

The equatorial radius of the sun, in metres.


Methods

cancelNova

function cancelNova()

Cancels a scheduled nova, if a nova has been scheduled but not yet occurred.

See Also: hasGoneNova, isGoingNova, goNova()

goNova

function goNova([delay : Number])

Causes the sun to explode. The optional delay parameter causes the nova to happen after a specified delay (specified in seconds in game real time).

See Also: hasGoneNova, isGoingNova, cancelNova()