-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoins.lua
51 lines (47 loc) · 1.32 KB
/
coins.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
49
50
51
local sprite = love.graphics.newImage("Sprites/coin.png")
local coins = {
sprite = sprite,
path = "Sprites/coin.png",
shadowpath = "Sprites/shadow coin.png",
quads = GetQuads(8, sprite),
hudtimer = 0,
soundtest = {name = "Lovely Bonus", subtitle = "Bonus levels", creator = "MAKYUNI", filename = "bonus.ogg"};
[4] = {x = 13, y = 9, got = false},
[5] = {x = 18, y = 5, got = false},
[9] = {x = 1, y = 1, got = false},
[11] = {x = 13, y = 13, got = false},
[13] = {x = 18, y = 16, got = false},
[14] = {x = 10, y = 13, got = false},
[16] = {x = 24, y = 3, got = false},
[21] = {x = 6, y = 5, got = false},
[24] = {x = 6, y = 3, got = false},
[25] = {x = 17, y = 9, got = false},
[26] = {x = 17, y = 11, got = false},
[28] = {x = 2, y = 2, got = false},
[30] = {x = 18, y = 18, got = false},
[33] = {x = 25, y = 12, got = false},
[34] = {x = 6, y = 14, got = false},
[35] = {x = 1, y = 13, got = false},
[39] = {x = 24, y = 20, got = false},
}
function coins.count()
local coinstotal = 0
local coinsgot = 0
for k, coin in pairs(coins) do
if type(k) == "number" then
coinstotal = coinstotal+1
if coin.got then
coinsgot = coinsgot+1
end
end
end
return coinsgot, coinstotal
end
function coins.reset()
for k, v in pairs(coins) do
if type(k) == "number" then
coins[k] = nil
end
end
end
return coins