summaryrefslogtreecommitdiff
path: root/examples/pong_vec/main.lua
diff options
context:
space:
mode:
authorjussi2022-05-31 00:31:39 +0300
committerjussi2022-05-31 00:31:39 +0300
commitb1bb77e1398b2f73623ef8c1e9cb2d7adbdea139 (patch)
tree4bdab9a8c45ac18bc95168e36252f2aa707fb782 /examples/pong_vec/main.lua
parent381adb3ba2e1c668bf29f95b8356ac8a859e0f3e (diff)
downloadreilua-enhanced-b1bb77e1398b2f73623ef8c1e9cb2d7adbdea139.tar.gz
reilua-enhanced-b1bb77e1398b2f73623ef8c1e9cb2d7adbdea139.tar.bz2
reilua-enhanced-b1bb77e1398b2f73623ef8c1e9cb2d7adbdea139.zip
Windows Lua build instructions.
Diffstat (limited to 'examples/pong_vec/main.lua')
-rw-r--r--examples/pong_vec/main.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/pong_vec/main.lua b/examples/pong_vec/main.lua
index 02d6a90..ed406e1 100644
--- a/examples/pong_vec/main.lua
+++ b/examples/pong_vec/main.lua
@@ -40,6 +40,7 @@ local function reset()
-- Set ball to center.
ball.pos:set( winSize.x / 2, winSize.y / 2 )
-- Short for if math random result 1, set BALL_SPEED otherwise set -BALL_SPEED.
+ -- Could be replaced by normal if statement for easier readability.
ball.vel.x = math.random( 0, 1 ) == 1 and BALL_SPEED or -BALL_SPEED
-- Start slow.
ball.vel.y = 0
@@ -123,7 +124,7 @@ function draw()
-- Draw ball. Ball position will be the center in drawCircle.
RL_DrawCircle( ball.pos, ball.radius, WHITE )
- -- Draw scire
+ -- Draw score.
RL_DrawText( 0, playerLeft.score, { 50, 10 }, 40, 2, WHITE )
local rightTextSize = Vec2:new( RL_MeasureText( 0, playerRight.score, 40, 2 ) )
RL_DrawText( 0, playerRight.score, { winSize.x - 50 - rightTextSize.x, 10 }, 40, 2, WHITE )