LunarBasic Language Reference

This guide explains the main parts of the LunarBasic language in a simple, beginner-friendly way.

Use the topics below to learn the basics first, then explore statements, functions, and expressions as you build more advanced programs.

Back to Welcome


Start Here

Working with Programs

You can combine these core topics. For example, a custom type can include array fields:

Type Player
    Field InventorySlots(8) As Integer
End Type

Dim p As Player
p = New Player
p.InventorySlots[0] = 3

See Types and Objects for object syntax and Arrays for indexing and length helpers such as ArrayLen.

Control Flow and Routines

Expressions and Troubleshooting

Tip for New Users

If you are just getting started, read the pages in this order: