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
|
|
@ -13,7 +13,7 @@ program TiledP5 {
|
|||
let iso = Tiled.load("assets/tiled-fixtures/isometric_grass_and_water.tmx")
|
||||
if Value.as_str(Value.get(Tiled.tree(iso), "orientation")) == "isometric" { print(1) }
|
||||
if Tiled.cell_x(iso, 1, 0) == 32 { print(2) } # (1-0)*64/2
|
||||
if Tiled.cell_x(iso, 0, 1) == 0 - 32 { print(3) } # (0-1)*64/2
|
||||
if Tiled.cell_x(iso, 0, 1) == -32 { print(3) } # (0-1)*64/2
|
||||
if Tiled.cell_y(iso, 1, 1) == 32 { print(4) } # (1+1)*32/2
|
||||
if Tiled.cell_y(iso, 2, 0) == 32 { print(5) } # (2+0)*32/2
|
||||
|
||||
|
|
@ -23,8 +23,8 @@ program TiledP5 {
|
|||
var cy = 0
|
||||
while cy < Tiled.height(iso) and g == 0 {
|
||||
var cx = 0
|
||||
while cx < Tiled.width(iso) and g == 0 { g = Tiled.gid(iso, 0, cx, cy); cx = cx + 1 }
|
||||
cy = cy + 1
|
||||
while cx < Tiled.width(iso) and g == 0 { g = Tiled.gid(iso, 0, cx, cy); cx += 1 }
|
||||
cy += 1
|
||||
}
|
||||
let r = Tiled.resolve(iso, g)
|
||||
if r.tileset == 0 and r.local >= 0 { print(6) }
|
||||
|
|
@ -48,8 +48,8 @@ program TiledP5 {
|
|||
var yy = 0
|
||||
while yy < 32 and painted == 0 {
|
||||
var xx = 0
|
||||
while xx < 32 and painted == 0 { if rt_get_px(xx, yy) != 0 { painted = 1 }; xx = xx + 1 }
|
||||
yy = yy + 1
|
||||
while xx < 32 and painted == 0 { if rt_get_px(xx, yy) != 0 { painted = 1 }; xx += 1 }
|
||||
yy += 1
|
||||
}
|
||||
if painted == 1 { print(14) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue