Getting Started with CSL
CSL is All Out's custom programming language built to make writing multiplayer games as easy as creating single player games.
Your first script (main.csl)
main.csl)import "core:ao"
// ============================================================================
// Global lifecycle
// ============================================================================
ao_before_scene_load :: proc() {
// Register item definitions, currencies, etc.
// Runs before the scene is created.
}
ao_start :: proc() {
// Called once when the scene starts.
}
ao_update :: proc(dt: float) {
// Called every frame.
}
ao_late_update :: proc(dt: float) {
// Called every frame after ao_update.
}
// ============================================================================
// Player lifecycle
// ============================================================================
Player :: class : Player_Base {
ao_start :: method() {
}
ao_update :: method(dt: float) {
}
ao_late_update :: method(dt: float) {
}
ao_end :: method() {
}
}Imports
Declarations (variables and constants)
Variables
Constants
Types
Primitive types
Vector types
Structs and classes
Structs (value types)
Classes (reference types)
Inheritance
Procedures and methods
Procedures (proc)
proc)Methods (method)
method)Field access vs method calls
Arrays
Control flow
If / else
Switch
While / for / foreach
Casting
Passing by reference: ref (preferred)
ref (preferred)Callbacks: function pointers + userdata (no closures)
Type info (types as values)
Best practices (CSL in All Out)
Last updated