wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run
ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic 1804 vars into 126 states, 64 into lets; 23498 edits in 460 files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5ffe50ed02
commit
19fcf60599
459 changed files with 17862 additions and 17603 deletions
|
|
@ -3,7 +3,7 @@
|
|||
# Running it prints: 1 2 3 4 5 6 7 8 9 10 11 12
|
||||
program Floats {
|
||||
const HALF: float = 0.5
|
||||
var g_gravity: float = -9.81
|
||||
let g_gravity: float = -9.81
|
||||
|
||||
property Body { x: float = 1.25, vy: float, mass: double = 70.5 }
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# Running it prints: 4294967295 3988292384 -4294967296 1099511627776 -3750763034362895579 -1 1
|
||||
program LongLiterals {
|
||||
const MASK: long = 4294967295
|
||||
var poly: long = 3988292384
|
||||
let poly: long = 3988292384
|
||||
function neg() -> long { return -4294967296 }
|
||||
entry {
|
||||
let big = 0x10000000000
|
||||
|
|
|
|||
|
|
@ -15,30 +15,32 @@
|
|||
# bin/ludic-dev game-build bin/ludicc examples/lang/scenes.ludic /tmp/scenes
|
||||
# printf 'aaaa' | /tmp/scenes
|
||||
program SceneDemo {
|
||||
var counter: int = 0
|
||||
state SceneDemoState {
|
||||
counter: int = 0
|
||||
}
|
||||
|
||||
handler Boot phase Start { counter = 0; print(1000) }
|
||||
handler Boot(scene_demo_st: mut SceneDemoState) phase Start { scene_demo_st.counter = 0; print(1000) }
|
||||
|
||||
scene Title start {
|
||||
on enter { print(1) }
|
||||
on exit { print(2) }
|
||||
layer Main {
|
||||
handler Tick phase Update {
|
||||
counter += 1
|
||||
print(100 + counter)
|
||||
if counter >= 2 { become Play }
|
||||
handler Tick(scene_demo_st: mut SceneDemoState) phase Update {
|
||||
scene_demo_st.counter += 1
|
||||
print(100 + scene_demo_st.counter)
|
||||
if scene_demo_st.counter >= 2 { become Play }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scene Play {
|
||||
on enter { print(3); counter = 0 }
|
||||
on enter (scene_demo_st: mut SceneDemoState) { print(3); scene_demo_st.counter = 0 }
|
||||
on exit { print(4) }
|
||||
layer World {
|
||||
handler Step phase Update {
|
||||
counter += 1
|
||||
print(200 + counter)
|
||||
if counter >= 2 { quit() }
|
||||
handler Step(scene_demo_st: mut SceneDemoState) phase Update {
|
||||
scene_demo_st.counter += 1
|
||||
print(200 + scene_demo_st.counter)
|
||||
if scene_demo_st.counter >= 2 { quit() }
|
||||
}
|
||||
}
|
||||
layer Hud {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue