-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
48 lines (39 loc) · 858 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
-- @author debuss-a
--
require "background"
require "ball"
function love.load(arg)
background = Background.new()
balls = {}
for i=1, 100 do
table.insert(
balls,
Ball.new(
nil,
nil,
{love.math.random(), love.math.random(), love.math.random(), 1},
love.math.random(100, 600)
)
)
end
end
function love.draw()
background:draw()
for k, ball in pairs(balls) do
ball:draw()
end
love.graphics.reset()
love.graphics.print("FPS : "..tostring(love.timer.getFPS()), 10, 10)
end
function love.update(dt)
background:update(dt)
for k, ball in pairs(balls) do
ball:update(dt)
end
end
function love.keyreleased(key)
if key == "escape" then
love.event.quit()
end
end