mirror of
https://codeberg.org/fairyglade/ly.git
synced 2026-08-18 19:44:23 +02:00
review pt 1
This commit is contained in:
parent
0c14f4367a
commit
cc14fff5c6
5 changed files with 160 additions and 161 deletions
|
|
@ -23,6 +23,9 @@ local SQUARE_WIDTH = 10
|
|||
local SQUARE_HEIGHT = 5
|
||||
|
||||
local SQUARE_COUNT = 25
|
||||
|
||||
local FPS = 120
|
||||
|
||||
local squares = {}
|
||||
|
||||
for i = 0, SQUARE_COUNT-1 do
|
||||
|
|
@ -44,7 +47,7 @@ local timer = os.clock()
|
|||
function draw()
|
||||
-- Rather than progressing the animation by frame, do it based on
|
||||
-- seconds, like from os.clock().
|
||||
if timer + 0.025 < os.clock() then
|
||||
if timer + (1/FPS) < os.clock() then
|
||||
ly.clear()
|
||||
for i, v in ipairs(squares) do
|
||||
v.x = v.x + v.vx
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue