Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dec = {}
- startLights = false
- ids = {0,1,2,4,9}
- function eventNewGame()
- startLights = false
- dec = {}
- count = 0
- xml = tfm.get.room.xmlMapInfo.xml
- decorations = xml:match('<D>[^ยด]+/>'):gsub("<D>","")
- for tree in decorations:gmatch('<P[^/]+/>') do
- if tree:match('T="57"') then
- count = count+1
- dec[count] = {
- X = tree:match('X="[0-9]+"'):gsub('X="',''):gsub('"',''),
- Y = tree:match('Y="[0-9]+"'):gsub('Y="',''):gsub('"','')
- }
- end
- end
- startLights = true
- end
- function eventLoop()
- if startLights then
- for counter = #dec,1,-1 do
- for k = 10,0,-1 do
- tfm.exec.displayParticle(ids[math.random(#ids)],dec[counter].X+math.random(-40,40),dec[counter].Y+math.random(-120,30),0,0,0,0)
- tfm.exec.displayParticle(11,dec[counter].X-2,dec[counter].Y-183,math.cos(k),math.sin(k),0,0)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement