blob: 29a81406ad9cc1b0bf68e7624199e1b2cdd13fc5 (
plain)
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
|
function addcircle(x, y, velx, vely, r, time, color)
local circle = {}
circle.x = x
circle.y = y
circle.velx = velx
circle.vely = vely
circle.r = r
circle.time = time
circle.t = time
circle.col = color
function circle.draw(circle)
circfill(circle.x, circle.y, circle.r*sin(circle.time/circle.t), circle.col)
end
function circle.update(circle)
circle.x += circle.velx
circle.y += circle.vely
circle.time -= 1/60
if circle.time < 0 then
del(obj, circle)
end
end
add(obj, circle)
end
|