diff options
Diffstat (limited to 'examples/pong/main.lua')
| -rw-r--r-- | examples/pong/main.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/pong/main.lua b/examples/pong/main.lua index ae3c321..b3f3f99 100644 --- a/examples/pong/main.lua +++ b/examples/pong/main.lua @@ -34,6 +34,7 @@ local function reset() -- Set ball to center. ball.pos = { winSize[1] / 2, winSize[2] / 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[1] = math.random( 0, 1 ) == 1 and BALL_SPEED or -BALL_SPEED -- Start slow. ball.vel[2] = 0 |
