Overview of Easel Subblocks
Spawn function, where the subblock defines the main behavior of the spawned entity.Spawn {
// This subblock defines the behavior of the spawned entity
}website·Indexed 33 days ago
https://easel.gamesA reactive, asynchronous, and event-driven programming language designed for game development. Easel features built-in support for multiplayer, a physics engine, and a UI system. The documentation covers core concepts like entities and behaviors, language control flow, and technical references for graphics, cameras, and input handling.
Spawn function, where the subblock defines the main behavior of the spawned entity.Spawn {
// This subblock defines the behavior of the spawned entity
}A buff is a property of an entity whose value is derived from a set of contributed values from multiple sender entities. Buffs are typically used for temporary effects like speed boosts or damage reduction. When a sender entity despawns, its contribution is automatically removed. The final value is calculated via a meld function, cached, and recalculated only when contributions change.
Note: Buffs are obsolete and have been superseded by Collectors. Use Collectors for all new code.
Easel games start in an 'unlocked' mode where players can freely join and leave. To prevent new players from joining (e.g., when a match is about to start), use the LockGame function.
Key behaviors:
LockGame applies immediately; any players attempting to join after this call will be reassigned to a different game.CommenceGame automatically locks the game if it hasn't been locked already.ConcludeGame also locks the game, preventing players from joining a finished session.You can modify the execution flow of loops using these statements:
break: Exits the loop immediately.continue: Skips the remainder of the current iteration and proceeds to the next iteration.World entity represents the global game world and exists for the entire duration of the program. It is used to store properties or own objects that must persist throughout the application's lifecycle.pub prop this.NightTime
pub fn Example() {
World.NightTime = true // assign a property to the World
}screenOffset to shift a shape along the horizontal and vertical axes of the screen. Note that this parameter is not supported by physics-related functions like PolygonCollider because the physics engine does not utilize the concept of a screen or camera.{
screenOffset: { x: 0, y: 0 }, // Offsets the shape on the screen axes
}Symbol type represents a unique identifier. Symbols are more performant for comparisons than strings and should be used whenever a unique identifier is needed. A symbol is only equal to itself.// Create inline symbols using the $name syntax
const x = $abc
x == $abc // true
x == $def // false