Getting Started
Language Reference
Graphics
API Reference — Core
Window & Graphics
Audio & Input
2D Sprites & Physics
3D Scene
System & Math
Level Editors
Comments are notes in your source code that the compiler ignores. Use them to explain what your code does.
Start a comment with a single quote '. Everything after it on that line is ignored:
'
' This entire line is a commentscore = score + 10 ' this comment follows code on the same line
Explain *why*, not *what*. The code itself shows what happens; a comment should explain the reasoning behind a decision.
' Subtract 1 from lives rather than setting to 0 so' the death animation plays before the game over screen.lives = lives - 1
Label sections of a longer program to help navigation:
' ---- Initialisation ----------------------------------------OpenWindow("My Game", 640, 480, false, true)' ---- Main Loop ---------------------------------------------While NOT Key(K_ESCAPE) Update()Wend
Disable code temporarily during debugging:
' DrawDebugOverlay() ' uncomment to enable debug mode
Comments
Comments are notes in your source code that the compiler ignores. Use them to explain what your code does.
Single-line Comments
Start a comment with a single quote
'. Everything after it on that line is ignored:Good Commenting Practices
Explain *why*, not *what*. The code itself shows what happens; a comment should explain the reasoning behind a decision.
Label sections of a longer program to help navigation:
Disable code temporarily during debugging: