diff --git a/examples/core_input_mouse.lua b/examples/core_input_mouse.lua new file mode 100644 index 0000000..af53001 --- /dev/null +++ b/examples/core_input_mouse.lua @@ -0,0 +1,30 @@ +rl.SetTraceLogLevel(rl.LOG_WARNING) +rl.SetConfigFlags(rl.FLAG_VSYNC_HINT) +rl.InitWindow(800, 450, "raylib [core] example - mouse input"); + +local ball_position = rl.new("Vector2", -100, -100) +local ball_color = rl.DARKBLUE + +while not rl.WindowShouldClose() do + ball_position.x = rl.GetMouseX() + ball_position.y = rl.GetMouseY() + + if rl.IsMouseButtonPressed(rl.MOUSE_LEFT_BUTTON) then + ball_color = rl.MAROON + elseif rl.IsMouseButtonPressed(rl.MOUSE_MIDDLE_BUTTON) then + ball_color = rl.LIME + elseif rl.IsMouseButtonPressed(rl.MOUSE_RIGHT_BUTTON) then + ball_color = rl.DARKBLUE + end + + rl.BeginDrawing() + + rl.ClearBackground(rl.RAYWHITE) + rl.DrawCircleV(ball_position, 40, ball_color) + rl.DrawText("move ball with mouse and click mouse button to change color", + 10, 10, 20, rl.DARKGRAY) + + rl.EndDrawing() +end + +rl.CloseWindow() \ No newline at end of file diff --git a/examples/physics_demo.lua b/examples/physics_demo.lua index 9c5999b..4437040 100644 --- a/examples/physics_demo.lua +++ b/examples/physics_demo.lua @@ -20,7 +20,7 @@ circle.enabled = false rl.SetTargetFPS(60) while not rl.WindowShouldClose() do - rl.RunPhysicsStep() + rl.UpdatePhysics() if needsReset then floor = rl.CreatePhysicsBodyRectangle({ screenWidth/2, screenHeight }, 500, 100, 10) diff --git a/raylib b/raylib index bc33201..005bc4c 160000 --- a/raylib +++ b/raylib @@ -1 +1 @@ -Subproject commit bc332018f67fc6dcefd9f236b9147f20f17f86ab +Subproject commit 005bc4c4143f2b79ffc18fa98be144c905d2ce7f