diff options
Diffstat (limited to 'comp/lucas-standen-NEA/code2/examples/raylib_example.zpy')
-rw-r--r-- | comp/lucas-standen-NEA/code2/examples/raylib_example.zpy | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy b/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy index 931c0e4..10f326e 100644 --- a/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy +++ b/comp/lucas-standen-NEA/code2/examples/raylib_example.zpy @@ -1,16 +1,36 @@ (defun main int) - (InitWindow 800 800 "test") - (SetTargetFPS 40) - (let x:int 0) - (let y:int 0) + (InitWindow 800 800 "test_test") + (SetTargetFPS 60) + + (let img:Image (LoadImage "dvd.png")) + (let tex:Texture (LoadTextureFromImage img)) + (UnloadImage img) + + (let x:int (randint 1 9)) + (let y:int (randint 1 9)) + (let xd:int (randint 1 5)) + (let yd:int (randint 1 5)) + (for i:int 0 (= (WindowShouldClose) 0) 0) (BeginDrawing) (ClearBackground RAYWHITE) - (DrawText "test" x y 40 RED) + (DrawTexture tex x y WHITE) (EndDrawing) - (set x (+ x 5)) - (set y (+ y 5)) + (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) |