docs: regenerate site from f094acfdb5
This commit is contained in:
commit
63c5ed9baf
975 changed files with 55427 additions and 0 deletions
38
kw-spawn.html
Normal file
38
kw-spawn.html
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>spawn — Ludic</title>
|
||||
<meta name="description" content="Create a model instance carrying the listed properties, seeding their fields.">
|
||||
<link rel="stylesheet" href="base.css">
|
||||
<link rel="stylesheet" href="docs.css">
|
||||
</head>
|
||||
<body>
|
||||
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
|
||||
<main class="wrap item">
|
||||
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <a href="api.html#ecs">Entities & the ECS</a> <span>›</span> <span class="here">spawn</span></div>
|
||||
<div class="item-head">
|
||||
<span class="kind-badge kind-keyword">keyword</span>
|
||||
<h1 id="top">spawn</h1>
|
||||
</div>
|
||||
<code class="sig">spawn Label { Prop { field: v }; … }</code>
|
||||
<div class="desc"><p>A <code>spawn</code> creates a new model instance and attaches the listed properties, each field starting from its default and then taking any overrides you give. The <code>Label</code> after <code>spawn</code> is just a readable name for the instance at that call site — it does not have to be a declared model — while the <code>{Prop { … }; …}</code> block is what actually determines which properties the instance carries. If you <code>spawn</code> a declared <code>model</code>, every property in that model comes along automatically. A newly spawned instance is visible to matching queries immediately, and one spawned mid-loop at a higher id is even visited in the same tick, so spawn into a later phase if you want to defer that.</p></div>
|
||||
|
||||
<div class="examples"><h2>Example</h2><pre data-lang="ludic">program Waves {
|
||||
property Position { column: int = 0, row: int = 0 }
|
||||
property Velocity { delta_x: int = 0, delta_y: int = 0 }
|
||||
property Health { current: int = 100, maximum: int = 100 }
|
||||
model Enemy { Position, Velocity, Health }
|
||||
|
||||
handler SpawnWave phase Start {
|
||||
spawn Grunt { Position { column: 18, row: 4 }; Velocity { delta_x: -1 }; Health { current: 20 } }
|
||||
spawn Brute { Position { column: 18, row: 9 }; Velocity { delta_x: -1 }; Health { current: 60 } }
|
||||
}
|
||||
}</pre></div>
|
||||
|
||||
<a class="back" href="api.html">← All symbols</a>
|
||||
</main>
|
||||
<script src="ludic-highlight.js"></script>
|
||||
<script>Ludic.highlightAll(); Ludic.installCards(); Ludic.flashTarget();</script>
|
||||
</body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue