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
|
|
@ -26,7 +26,7 @@ program TiledP05 {
|
|||
# --- four layers, every encoding decodes to the SAME 16-GID array ---
|
||||
let layers = Value.get(m, "layers")
|
||||
if Value.count(layers) == 4 { print(8) }
|
||||
let FLIP = 0 - 2147483647 # 0x80000001 as i32
|
||||
let FLIP = -2147483647 # 0x80000001 as i32
|
||||
var same = 1
|
||||
var li = 0
|
||||
while li < 4 {
|
||||
|
|
@ -35,7 +35,7 @@ program TiledP05 {
|
|||
if Value.as_int(Value.at(data, 0)) != 1 { same = 0 }
|
||||
if Value.as_int(Value.at(data, 14)) != 15 { same = 0 }
|
||||
if Value.as_int(Value.at(data, 15)) != FLIP { same = 0 }
|
||||
li = li + 1
|
||||
li += 1
|
||||
}
|
||||
if same == 1 { print(9) }
|
||||
# the CSV path and the gzip path agree on the flip-flagged GID
|
||||
|
|
@ -61,9 +61,9 @@ program TiledP05 {
|
|||
var gi = 0
|
||||
while gi < 16 {
|
||||
if Value.as_int(Value.at(jdata, gi)) != Value.as_int(Value.at(csvdata, gi)) { jsame = 0 }
|
||||
gi = gi + 1
|
||||
gi += 1
|
||||
}
|
||||
jli = jli + 1
|
||||
jli += 1
|
||||
}
|
||||
if jsame == 1 { print(16) }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue