Combat
Turning combat on
Combat is off by default. For a world that needs it, tick “Enable combat” under World settings → Basic info → Combat system. Once enabled, the skill bar, skill book, target selection, enemy attacks and projectiles work in test runs and multiplayer instances.
Turning combat off does not affect skill editing: the skill library and enemy attack settings remain, they simply do nothing at run time. You can build everything first and decide later.
Movement such as patrol and wander is not affected by the combat switch: props and NPCs still move. Only aggro, chasing and enemy attacks are controlled by it.
Skills
Click “⚔ Skills” in the toolbar to open the skill library and create a skill. Each skill is made of: a name, an icon (chosen from image materials), a description, a cooldown (seconds), a range (tiles), a target mode, plus optional area damage and functions.
There are three target modes: “Self” only affects you; “Single target” needs one target; “Ground point” lets the user pick a spot. When you set area damage (AOE), choose whether its centre is you, the target or the point.
A skill's behaviour comes from functions — fill in only the ones you need. The cast function runs once per cast (good for spending mana or playing an animation); the target function runs once for every affected target; the target filter is a pure function that picks valid targets; the unlock and cast conditions are pure functions too, where a non-zero result means unlocked / castable.
Inside the target function, [..variable] refers to this target and [.variable] to the caster. The cast function and target function run separately, so area damage never charges the same cost many times — put the mana cost in the cast function and it is spent once.
A projectile makes the skill launch a flying object: choose its sprite, speed, hit radius, maximum distance and whether it pierces. With a projectile, the target function runs only on hit or at the landing point; hitting a wall does nothing for a single-target skill, while an area skill explodes at the landing point.
A skill can name a prerequisite, forming a skill tree: a lower skill can only unlock once the one above it is unlocked. The library shows the tree indented, and sibling skills can be reordered. A skill that other skills depend on cannot be deleted — change their prerequisite or delete them first.
Slots and controls
Every user has four skill slots. In a test run or game, press K to open the skill book and bind unlocked skills to slots 1–4; empty slots are grey and cooling-down skills show a clock-style sweep.
Slots are never filled automatically: a new user starts with all four empty, and binds skills in the skill book. Bindings persist with that user's save, so there is no need to bind again next time; they are not carried into other worlds.
On a computer: press 1–4 to cast the matching slot; hovering a target shows a blue outline, clicking to lock shows a gold one; right-clicking an enemy locks it and casts slot 1 directly; right-clicking empty ground clears the lock. For a ground-point skill, press 1–4 then click the ground; press Esc to cancel.
On a phone: tap a target to lock it and tap a skill button to cast. With no locked target the nearest valid one is chosen automatically, and ground-point skills smart-target the locked target or yourself. The four skill buttons sit in a thumb arc at the bottom right; the skill book button is top centre, under the scene name.
The touch joystick is analogue: beyond its dead zone, the farther you push the faster you go, and pushing all the way to the edge runs. When speed reaches half of the maximum, the character switches to the run animation.
Enemy attacks
Only NPCs can be enemies, and these settings appear only with combat enabled. Enemy attacks live in two places: the “Basic | Combat” tabs of the object definition dialog hold the default shared by every instance; the “Properties | Combat” tabs of the instance inspector can override it. Instances without an override show an inherited summary; click “Override” to copy a custom one, or “Reset to inherited” to remove it.
Attack settings include range (tiles, default 2), interval (seconds, default 1), attack conditions, attack compute, fire audio, and an optional projectile. Without a projectile, valid targets in range are resolved immediately; with one, it fires at the nearest user or in a random direction according to “Projectile target”, and resolves only on hit.
In attack conditions and compute, [..] refers to the enemy itself and [.] to the user who was hit (reading their user variables). You can read the enemy's own attack power in compute, for example subtracting [..attackPower] from the target's HP.
Enemies need no trigger: centred on their current position, they automatically hit users in range at the set interval. A moving enemy attacks from wherever it has chased to.
HP
With combat enabled, every NPC has a built-in HP variable (_hp), default 100. Give different initial values in the object definition, per-instance variables or the prefab dialog to make enemies stronger or weaker.
An initial value of -1 means invincible: all damage writes are then ignored; write 0 or a positive value to remove it. Only NPCs have HP — a value on any other object is removed.
A small HP bar floats above each NPC, scaled to that NPC's initial HP: above half it is green, above a quarter yellow, below that red. It is not drawn when invincible, at zero HP or when the object is hidden; the editing canvas does not draw it, only test runs and games do.
In formulas: [.._hp] for this NPC's own HP, or [scene.object._hp] across objects or on a HUD — usable in conditions, compute, state sprites and skill target functions.
Targeting
Hovered or locked targets are highlighted with an outline around their sprite: blue on hover, gold when locked. Only NPCs can be locked; props, items, gates and lights never become targets.
Every NPC has a read-only built-in variable “Selected” (_selected): 0 or 1, meaning whether you have locked this NPC. Hovering does not count — only an explicit click or right-click lock does. In multiplayer worlds each user has their own copy, independent of others.
It is not saved and returns to 0 after re-entering or changing scenes; with combat off it is always 0 and writing it does nothing. In formulas: [.._selected] for the NPC itself, or [scene.object._selected] on a HUD or from another object.
Moving units
Props and NPCs can move. Select an object, add movement in the inspector's “Movement” section, and pick a mode: patrol walks back and forth along waypoints, wander roams randomly around its spawn point, and follow escorts a user or another unit. Movement belongs to the object, not a new type; items, info, triggers, gates, lights and UI cannot move yet. Objects spawned from a prefab do not move (patrol, wander and follow are ignored when spawning); for moving spawned objects, use moving units pre-placed in the scene and control visibility and spawning with variables.
Patrol shows waypoints and connecting lines on the canvas. Drag a dot to move a waypoint; hover a dot to reveal × and click to delete it; hover the middle of a line to reveal + and click to add a waypoint. Set the speed and how long to pause at each point.
Wander roams randomly within a set radius around its spawn point. Follow escorts the nearest user by default, or a chosen scene unit, keeping a set distance.
Aggro and chasing work only for NPCs with combat enabled: set the aggro radius, leash distance and chase speed. Inside the aggro radius the unit chases the nearest user, stops to attack within its attack range, and returns to patrol or its spawn point beyond the leash distance. Walls block aggro, and chasing paths around blocked tiles. When a unit is selected, the canvas shows its aggro radius as a light-red circle.
Moving units are blocked by static blocked tiles, but do not collide with users or other units — people and units can pass through each other. Positions last only for the current play session: after changing scenes, re-entering the world or reloading, units return to their spawn points. Movement is not supported in side-view platform scenes yet; a configured unit will not move there. Objects spawned from a prefab do not move either (patrol, wander and follow are ignored when spawning); for moving spawned objects, use moving units pre-placed in the scene and control visibility and spawning with variables.
Multiplayer
In a multiplayer world each user has their own skill bindings, cooldowns and target lock, independent of others. Enemy attacks, skill hits and projectiles are resolved by the platform, so everyone sees the same fight.
Damage and HP live on shared object variables, so any user's hit changes the same enemy's HP; personal data such as a user's own HP is kept per user. After a reconnect, transient visuals such as projectiles in flight are cleared, and damage and state follow the platform's current result.
For now the only combat targets are NPCs — users cannot attack each other yet. Multiplayer worlds follow the same combat switch: with it off there is no skill bar, target lock or enemy attack.
