summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/pong_vec/main.lua1
-rw-r--r--examples/snake/main.lua10
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/pong_vec/main.lua b/examples/pong_vec/main.lua
index 705e68f..4bf3d35 100644
--- a/examples/pong_vec/main.lua
+++ b/examples/pong_vec/main.lua
@@ -59,6 +59,7 @@ function init()
local mPos = Vec2:new( RL_GetMonitorPosition( monitor ) )
local mSize = Vec2:new( RL_GetMonitorSize( monitor ) )
+ RL_SetConfigFlags( FLAG_VSYNC_HINT )
RL_SetWindowSize( winSize )
RL_SetWindowPosition( { mPos.x + mSize.x / 2 - winSize.x / 2, mPos.y + mSize.y / 2 - winSize.y / 2 } )
RL_SetWindowTitle( "Pong" )
diff --git a/examples/snake/main.lua b/examples/snake/main.lua
index 1fe6ae7..d6e4fa5 100644
--- a/examples/snake/main.lua
+++ b/examples/snake/main.lua
@@ -158,11 +158,11 @@ end
--[[ Check if next segment is on left side. There are more mathematically elegant solution to this, but there is
only four possibilities so we can just check them all. ]]--
-local function onLeft( this, next )
- return ( vector2IsEqual( this, { 0, -1 } ) and vector2IsEqual( next, { -1, 0 } ) )
- or ( vector2IsEqual( this, { -1, 0 } ) and vector2IsEqual( next, { 0, 1 } ) )
- or ( vector2IsEqual( this, { 0, 1 } ) and vector2IsEqual( next, { 1, 0 } ) )
- or ( vector2IsEqual( this, { 1, 0 } ) and vector2IsEqual( next, { 0, -1 } ) )
+local function onLeft( this, nextSeg )
+ return ( vector2IsEqual( this, { 0, -1 } ) and vector2IsEqual( nextSeg, { -1, 0 } ) )
+ or ( vector2IsEqual( this, { -1, 0 } ) and vector2IsEqual( nextSeg, { 0, 1 } ) )
+ or ( vector2IsEqual( this, { 0, 1 } ) and vector2IsEqual( nextSeg, { 1, 0 } ) )
+ or ( vector2IsEqual( this, { 1, 0 } ) and vector2IsEqual( nextSeg, { 0, -1 } ) )
end
local function drawSnake()