-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheffect.lua
More file actions
38 lines (35 loc) · 878 Bytes
/
effect.lua
File metadata and controls
38 lines (35 loc) · 878 Bytes
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
---------------------------------
-- effect.lua
-- make effect of game
---------------------------------
function neweffect(x, y, kind) --kind: 0-smoke 1-explode
-- make new effect
if kind == 0 then
if mute == false then
love.audio.play(tblse[5])
end
elseif kind == 1 then
if mute == false then
love.audio.play(tblse[4])
end
end
local a
for a = 1, #tbleffect do
-- find not-enabled effect
if tbleffect[a]["enabled"] == false then
tbleffect[a]["x"] = x
tbleffect[a]["y"] = y
tbleffect[a]["kind"] = kind
tbleffect[a]["animation"] = 0
tbleffect[a]["enabled"] = true
return
end
end
-- can't find it? make new one
tbleffect[#tbleffect + 1] = {}
tbleffect[#tbleffect]["x"] = x
tbleffect[#tbleffect]["y"] = y
tbleffect[#tbleffect]["kind"] = kind
tbleffect[#tbleffect]["animation"] = 0
tbleffect[#tbleffect]["enabled"] = true
end