refactor(runtime,packages,examples): named constants, package enums, idiom sweep
- runtime: HEADLESS_FRAME_PATH, STICK_DEADZONE / STICK_LEFT_X/Y, key and byte codes as char literals throughout (`k == 'w'`, `fill(rt_map, ' ', …)`) - ludic.gameplay/stats: drop the duplicate `stat_field` (it answered "atk" for every build stat); Stats.base uses stats_field_name - ludic.shooter: compare aim modes and fire patterns with AimMode.* and WeaponPattern.* instead of raw ints; STICK_RIGHT_X/Y - ludic.npcai: DecisionMade / brain_set_state use AiState.* - examples/games/menu.ludic uses Font.load / Ui.* with FONT_PATH and BACKDROP named; strings.ludic header says what it prints - whole tree: `x = x + 1` → `x += 1` (single-term right-hand sides only), `0 - x` → `-x`, ASCII codes → char literals; every .ludic and every ```ludic fence reformatted with the fixed formatter (whitespace only) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
e3e1bc7784
commit
bf36bc8a8f
103 changed files with 1256 additions and 1252 deletions
|
|
@ -32,11 +32,11 @@ function reflect_serialize(e: int) -> Val {
|
|||
var node = value_int(raw)
|
||||
if world_field_type(p, f) == "fixed" { node = value_fixed(raw) }
|
||||
value_put(comp, fname, node)
|
||||
f = f + 1
|
||||
f += 1
|
||||
}
|
||||
value_put(obj, world_prop_name(p), comp)
|
||||
}
|
||||
p = p + 1
|
||||
p += 1
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ function reflect_apply(e: int, v: Val) -> int {
|
|||
var i = 0
|
||||
while i < value_count(v) {
|
||||
let pname = value_key_at(v, i)
|
||||
if pname[0] != 64 { # skip reserved "@…" keys
|
||||
if pname[0] != '@' { # skip reserved "@…" keys
|
||||
let p = world_prop_id(pname)
|
||||
if p >= 0 and world_has(e, p) != 0 {
|
||||
let comp = value_at(v, i)
|
||||
|
|
@ -59,13 +59,13 @@ function reflect_apply(e: int, v: Val) -> int {
|
|||
let f = world_field_id(p, fname)
|
||||
if f >= 0 {
|
||||
world_set(e, p, f, value_as_int(value_at(comp, j)))
|
||||
set = set + 1
|
||||
set += 1
|
||||
}
|
||||
j = j + 1
|
||||
j += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
i = i + 1
|
||||
i += 1
|
||||
}
|
||||
return set
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue