diff options
| author | jussi | 2022-06-19 12:18:09 +0300 |
|---|---|---|
| committer | jussi | 2022-06-19 12:18:09 +0300 |
| commit | 1529202e26a02461708784d8830475261893a537 (patch) | |
| tree | 134f627a4eb131f1daf0b3541fe925b7e5bcc6fb /examples/platformer/main.lua | |
| parent | 7b26e0aa68fb45612083b8e6b5c970564804803d (diff) | |
| download | reilua-enhanced-1529202e26a02461708784d8830475261893a537.tar.gz reilua-enhanced-1529202e26a02461708784d8830475261893a537.tar.bz2 reilua-enhanced-1529202e26a02461708784d8830475261893a537.zip | |
RLGL line width functions.
Diffstat (limited to 'examples/platformer/main.lua')
| -rw-r--r-- | examples/platformer/main.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/platformer/main.lua b/examples/platformer/main.lua index bef5786..d1160e1 100644 --- a/examples/platformer/main.lua +++ b/examples/platformer/main.lua @@ -84,6 +84,7 @@ function init() local monitorPos = Vec2:new( RL_GetMonitorPosition( monitor ) ) local monitorSize = Vec2:new( RL_GetMonitorSize( monitor ) ) + RL_SetConfigFlags( FLAG_VSYNC_HINT ) RL_SetWindowTitle( "Platformer" ) RL_SetWindowState( FLAG_WINDOW_RESIZABLE ) RL_SetWindowSize( winSize ) @@ -121,6 +122,7 @@ local function tileCollision( entity ) if isTileWall( Vec2:new( tileRect[3], y ) ) then -- Use new_x to push out of tile. local new_x = tileRect[3] * TILE_SIZE - ( entity.colRect[1] + entity.colRect[3] ) + entity.vel.x = new_x - tinyGap break @@ -128,7 +130,7 @@ local function tileCollision( entity ) elseif entity.vel.x < 0 then if isTileWall( Vec2:new( tileRect[1], y ) ) then local new_x = ( tileRect[1] * TILE_SIZE + TILE_SIZE ) - entity.colRect[1] - entity.vel.x = new_x + tinyGap, 0 + entity.vel.x = new_x + tinyGap break end |
