diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2024-10-15 10:19:30 +0100 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2024-10-15 10:19:30 +0100 |
commit | faef2d81c224b715c5e429d04c59ba50fb772d9e (patch) | |
tree | 2f75197a884ded3486c14e09908cb23bd24b968c /comp/lucas-standen-NEA/code2/examples/raylib_example/main.zpy | |
parent | 3564e513623bb3fc4d528d3d29df9aa91dae1396 (diff) |
added a stupid amount of work to zpy, and started the document work in latex
rather than groff
Diffstat (limited to 'comp/lucas-standen-NEA/code2/examples/raylib_example/main.zpy')
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/raylib_example/main.zpy | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/comp/lucas-standen-NEA/code2/examples/raylib_example/main.zpy b/comp/lucas-standen-NEA/code2/examples/raylib_example/main.zpy new file mode 100644 index 0000000..cd6a382 --- /dev/null +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example/main.zpy @@ -0,0 +1,37 @@ +//# this function is my main loop +(defun main int) + (InitWindow 800 800 "test test") + (SetTargetFPS 60) + + (let img:Image (LoadImage "dvd.png")) + (let tex:Texture (LoadTextureFromImage img)) + (UnloadImage img) + + (let x:int (randint 4 9)) + (let y:int (randint 4 9)) + (let xd:int (randint 3 5)) + (let yd:int (randint 3 5)) + + (for i:int 0 (= (WindowShouldClose) 0) 0) + (BeginDrawing) + (ClearBackground RAYWHITE) + (DrawTexture tex x y WHITE) + (EndDrawing) + + (set x (+ x xd)) + (set y (+ y yd)) + + (if (> x 750)) + (set xd -xd) + (elif (< x 0)) + (set xd -xd) + (endif) + (if (> y 750)) + (set yd -yd) + (elif (< y 0)) + (set yd -yd) + (endif) + + (endfor) + (CloseWindow) +(endfun) |