mirror of
https://github.com/bvanroll/Love2d.git
synced 2025-08-29 20:12:47 +00:00
organizing folders
This commit is contained in:
28
HomeMadeLibs/balls.lua
Normal file
28
HomeMadeLibs/balls.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
balls = {
|
||||
xcors = {},
|
||||
ycors = {},
|
||||
dia = {},
|
||||
segs = {},
|
||||
spesh = {},
|
||||
mov = {},
|
||||
spd = {},
|
||||
tresh = {},
|
||||
tmptresh = {},
|
||||
update = function(self, val, len)
|
||||
for i,v in ipairs(self.dia) do
|
||||
if (val > self.tresh[i])then
|
||||
self.tresh[i] = self.tresh[i] +self.tmptresh[i]
|
||||
self.dia[i] = math.sin((val/self.spesh[i]) * math.pi) * len
|
||||
if self.mov[i] >= .5 then
|
||||
self.xcors[i] = self.xcors[i] + math.random(-1 * self.spd[i], self.spd[i])
|
||||
self.ycors[i] = self.ycors[i] + math.random(-1 * self.spd[i], self.spd[i])
|
||||
if self.xcors[i] > wwidth then self.xcors[i] = wwidth end
|
||||
if self.ycors[i] > wheight then self.ycors[i] = wheight end
|
||||
if self.xcors[i] < 0 then self.xcors[i] = 0 end
|
||||
if self.ycors[i] < 0 then self.ycors[i] = 0 end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
Reference in New Issue
Block a user