Luna Logic

Luna Logic was an in-progress programming language written by Jacob Grahn for his unfinished game Luna. It was released as the game's final update in November 2012 and is in-complete.
Luna Logic allowed players to code more advanced behaviors for their matter, with the available options below taken from an in-game tab."Luna Logic Documentation" - Jiggmin's Village
== Variables ==
x
y
accelX
accelY
accelRot
velX
velY
velRot
explodeForce
explodeRadius
healForce
healRadius
followVel
stepSpeed
== Commands ==
face target
Rotate to point towards a target.
look like matter
Take on the appearance of another object.
feel like matter
Take on the properties of another object. Size, mass, health, etc.
act like matter
Take on the logic of another object.
become matter
Completely transform into the target object.
glide x y
Sets velX and velY to achieve the desired distance.
teleport x y
Adds an x and y value to this object's current position.
explode
Explode! Damage surrounding objects and ships. Amount of damage is determined by the variables explodeForce and explodeRadius.
heal
Heal surrounding objects and ships. Amount of healing is determined by the variables healForce and healRadius.
follow target
Move towards a target.
vanish
This object will cease to exist.
== Keywords ==
logic
Separates steps into independent groups.
Example:
*#make a tracking mine with a flashing light
**logic
***step 1
****show layer Flashy Light
***step 2
****hide layer Flashy Light
**logic
***step 1
****wait until ship distance < 100
***step 2
****follow ship
****wait until touch
***step 3
****explode
****vanish
step
Separates commands into groups that will run with a time delay in between them.
Example:
*#make an object that will periodically start and stop spinning
**step 1
***velAccel = .1
**step 2
***velAccel = -.1
if
Commands after an 'if' statement will only run if the condition is true.
Example:
*#make a healing fountain
**if ship distance < 100
***heal
else
If an 'if' statement is false, commands after the 'else' statement will be run instead.
Example:
*#make a fountain that might heal you or hurt you
**randomNumber = either 0 or 1
**if randomNumber equals 1
***heal
**else
***explode
start
Start a logic group.
Example:
*#make a tracking mine that flashes a light when chasing its target
**hide layer Flashy Light
----
*logic LightLogic
**step 1
***show layer Flashy Light
**step 2
***#do nothing
----
*logic AI
**step 1
***stop LightLogic
***wait until ship distance < 100
**step 2
***start LightLogic
***follow ship
***wait until touch
**step 3
***explode
***vanish
stop
Stop a logic group.
Example:
*#make a rocket that can run out of gas
**hide layer Flame 1
**hide layer Flame 2
----
*logic FlameAnimation
**step 1
***show layer Flame 1
**step 2
***show layer Flame 2
----
*logic AI
**step 1
***accelX = .1
**step 2
***stop FlameAnimation
***stop AI
==References==
Category:Miscellaneous