wip(0.S2): migrate - a var nothing writes becomes a let; a state is keyed by its module, directory or program, so every program's plan agrees; paths normalized; program states named SceneDemoState / scene_demo_st; the LSP reads state, mut and entry/handler parameters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3eda72e8c2
commit
5ffe50ed02
463 changed files with 72045 additions and 67421 deletions
|
|
@ -8,12 +8,10 @@ program Managers {
|
|||
property Tag { n: int = 0 }
|
||||
model Thing { Position, Body, Sprite, Tag, TopDown }
|
||||
model WorldRules { Solids }
|
||||
state ManagersState {
|
||||
frames: int = 0
|
||||
}
|
||||
handler Tick(managers_st: mut ManagersState) phase Update {
|
||||
managers_st.frames += 1
|
||||
if managers_st.frames == 1 {
|
||||
var frames: int = 0
|
||||
handler Tick phase Update {
|
||||
frames += 1
|
||||
if frames == 1 {
|
||||
Map.size(10, 8)
|
||||
Map.fill(glyph: '.')
|
||||
Map.border(glyph: '#')
|
||||
|
|
@ -38,7 +36,7 @@ program Managers {
|
|||
Fx.number(x: 20, y: 20, value: 42, color: 0xffff00)
|
||||
spawn Thing { Position { x: 20, y: 20 }, Sprite { id: 5, move_id: 9, face: 1, flash: 3, blink: 6 }, TopDown { want_x: -1 } }
|
||||
}
|
||||
if managers_st.frames == 3 { print(Map.is_solid(x: 0, y: 0) * 10 + Map.is_solid_at(x: 40, y: 40)) } # 10
|
||||
if managers_st.frames == 5 { for (s, t) in query [Sprite, Tag] { print(s.flip * 100 + s.flash * 10 + s.blink) }; quit() } # 102
|
||||
if frames == 3 { print(Map.is_solid(x: 0, y: 0) * 10 + Map.is_solid_at(x: 40, y: 40)) } # 10
|
||||
if frames == 5 { for (s, t) in query [Sprite, Tag] { print(s.flip * 100 + s.flash * 10 + s.blink) }; quit() } # 102
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue