We really need to log depth While here for the main game loop
March 2, 2023 · View on GitHub
otherwise we'd run out of stack so quickly
While ← {𝕩{𝔽⍟𝔾∘𝔽_𝕣_𝔾∘𝔽⍟𝔾𝕩}𝕨@}´ r←{
On Windows: raylib.dll
On MacOS: libraylib.dylib (I think)
r←"libraylib.so"
initWindow⇐r •FFI ""‿"InitWindow"‿"i32"‿"i32"‿"&i32:c8" windowShouldClose⇐r •FFI "i32"‿"WindowShouldClose" closeWindow⇐r •FFI ""‿"CloseWindow" setTargetFPS⇐r •FFI ""‿"SetTargetFPS"‿">i32" getFrameTime⇐r •FFI "f32"‿"GetFrameTime" getFPS⇐r •FFI "i32"‿"GetFPS"
pollInputEvents⇐r •FFI ""‿"PollInputEvents" isKeyPressed⇐r •FFI "i32"‿"IsKeyPressed"‿">i32"
beginDrawing⇐r •FFI ""‿"BeginDrawing" endDrawing⇐r •FFI ""‿"EndDrawing" clearBackground⇐r •FFI ""‿"ClearBackground"‿">{u8,u8,u8,u8}" drawCircle⇐r •FFI ""‿"DrawCircle"‿"i32"‿"i32"‿"f32"‿"{u8,u8,u8,u8}"
kEsc⇐256 cWhite⇐4⥊255 ⋄ cBlack⇐(3⥊0)∾255 cRed‿cGreen‿cBlue⇐(∾⟜255∘⌽⟜255‿0‿0)¨-↕3 cYellow‿cCyan‿cMagenta⇐(∾⟜255∘⌽⟜255‿255‿0)¨-↕3 }
s←100 pos←200‿200 w←30
r.InitWindow 400‿400‿("Raylib + BQN!"∾0) r.SetTargetFPS 60 shouldClose←0
Uh, WindowShoulcClose never returns true??
While {𝕤⋄¬shouldClose∨r.WindowShouldClose ⟨⟩}‿{𝕤 r.IsKeyPressed r.kEsc ? shouldClose↩1 ; @
t←r.GetFrameTime @
# 0≠ because booleans are real wacky for some reason
d←0‿0++´⟨0‿¯1,¯1‿0,0‿1,1‿0⟩/˜0≠r.IsKeyPressed¨ "WASD"-@
pos+↩s×d×t
r.BeginDrawing ⟨⟩
r.ClearBackground r.cBlack
r.DrawCircle (⌊¨pos)∾w∾<r.cRed
r.EndDrawing ⟨⟩
} r.CloseWindow ⟨⟩