Difference between revisions of "Oolite JavaScript Reference: Sun"

From Elite Wiki
(Fixed dangling small)
(Added Links)
 
(3 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
=== <code>hasGoneNova</code> ===
 
=== <code>hasGoneNova</code> ===
 
  '''hasGoneNova''' : Boolean (read-only)
 
  '''hasGoneNova''' : Boolean (read-only)
True if the sun has gone nova.
+
<code>true</code> if the sun has gone nova.
  
 
'''See Also:''' <code>[[#isGoingNova|isGoingNova]]</code>, <code>[[#goNova|goNova]]()</code>
 
'''See Also:''' <code>[[#isGoingNova|isGoingNova]]</code>, <code>[[#goNova|goNova]]()</code>
Line 13: Line 13:
 
=== <code>isGoingNova</code> ===
 
=== <code>isGoingNova</code> ===
 
  '''isGoingNova''' : Boolean (read-only)
 
  '''isGoingNova''' : Boolean (read-only)
True if the sun is scheduled to go nova.
+
<code>true</code> if the sun is scheduled to go nova.
  
 
'''See Also:''' <code>[[#hasGoneNova|hasGoneNova]]</code>, <code>[[#goNova|goNova]]()</code>, <code>[[#cancelNova|cancelNova]]()</code>
 
'''See Also:''' <code>[[#hasGoneNova|hasGoneNova]]</code>, <code>[[#goNova|goNova]]()</code>, <code>[[#cancelNova|cancelNova]]()</code>
 +
 +
=== <code>name</code> ===
 +
{{oolite-prop-added|1.79}}
 +
'''name''' : String (read-only)
 +
The name of the sun, as set by the <code>sun_name</code> property in [[planetinfo.plist]]
  
 
=== <code>radius</code> ===
 
=== <code>radius</code> ===
Line 35: Line 40:
  
 
'''See Also:''' <code>[[#hasGoneNova|hasGoneNova]]</code>, <code>[[#isGoingNova|isGoingNova]]</code>, <code>[[#cancelNova|cancelNova]]()</code>
 
'''See Also:''' <code>[[#hasGoneNova|hasGoneNova]]</code>, <code>[[#isGoingNova|isGoingNova]]</code>, <code>[[#cancelNova|cancelNova]]()</code>
 +
 +
== Links ==
 +
*See Frame's 2017 YouTube film [https://www.youtube.com/watch?v=e03qmsNYbkM here] where he discusses plans for barycenters such as binary stars, asteroid rings ''etc''. - and having everything to a realistic scale.
  
 
[[Category:Oolite JavaScript Reference]]
 
[[Category:Oolite JavaScript Reference]]

Latest revision as of 09:32, 10 January 2024

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()

name

This property was added in Oolite test release 1.79.

name : String (read-only)

The name of the sun, as set by the sun_name property in planetinfo.plist

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()

Links

  • See Frame's 2017 YouTube film here where he discusses plans for barycenters such as binary stars, asteroid rings etc. - and having everything to a realistic scale.