|
@@ -60,7 +60,7 @@ aey=0
|
|
|
v=0
|
|
|
|
|
|
options = {
|
|
|
- music = false,
|
|
|
+ music = true,
|
|
|
debug = true,
|
|
|
}
|
|
|
|
|
@@ -105,20 +105,17 @@ particletype='rain' -- snow|rain|stars
|
|
|
particles = {}
|
|
|
local starcolors = { 1, 2, 13, 15}
|
|
|
function particleinit(numparticles)
|
|
|
- -- if particletype == 'stars' then
|
|
|
- -- for i = 0, numparticles do
|
|
|
- -- table.insert(particles, {
|
|
|
- -- x = math.random() * 240,
|
|
|
- -- y = math.random() * waterlevel,
|
|
|
- -- twinkle = math.random() > 0.49, -- randomly pick true/false
|
|
|
- -- lastx = 0,
|
|
|
- -- lasty = 0,
|
|
|
- -- color = starcolors[math.random(#starcolors)],
|
|
|
- -- t = 0,
|
|
|
- -- })
|
|
|
- -- end
|
|
|
- -- trace("created some stars")
|
|
|
- -- end
|
|
|
+ if particletype == 'stars' then
|
|
|
+ for i = 0, numparticles do
|
|
|
+ table.insert(particles, {
|
|
|
+ x = math.random() * 240,
|
|
|
+ y = math.random() * waterlevel,
|
|
|
+ twinkle = math.random() > 0.49, -- randomly pick true/false
|
|
|
+ color = starcolors[math.random(#starcolors)],
|
|
|
+ t = 0,
|
|
|
+ })
|
|
|
+ end
|
|
|
+ end
|
|
|
if particletype == 'rain' or particletype == 'snow' then
|
|
|
for i = 0, numparticles do
|
|
|
color = 2
|
|
@@ -126,56 +123,38 @@ function particleinit(numparticles)
|
|
|
table.insert(particles, {
|
|
|
x = math.random() * 240,
|
|
|
y = math.random() * waterlevel,
|
|
|
- last_x = math.random() * 0,
|
|
|
- last_y = math.random() * 0,
|
|
|
+ lastx = 0,
|
|
|
+ lasty = -3,
|
|
|
color = 2,
|
|
|
- t = 0,
|
|
|
+ t = 0,
|
|
|
+ vel = (math.random() * 3) + 1,
|
|
|
})
|
|
|
end
|
|
|
- trace("created some " .. particletype)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
-function dump(o)
|
|
|
- if type(o) == 'table' then
|
|
|
- local s = '{ '
|
|
|
- for k,v in pairs(o) do
|
|
|
- if type(k) ~= 'number' then k = '"'..k..'"' end
|
|
|
- s = s .. '['..k..'] = ' .. dump(v) .. ','
|
|
|
- end
|
|
|
- return s .. '} '
|
|
|
- else
|
|
|
- return tostring(o)
|
|
|
- end
|
|
|
- end
|
|
|
-
|
|
|
function particleupdate()
|
|
|
- -- if particletype == 'stars' then
|
|
|
- -- for i = 1,#particles do
|
|
|
- -- local p = particles[i]
|
|
|
- -- if not p.twinkle then goto continueTwinkle end
|
|
|
- -- ::continueTwinkle::
|
|
|
- -- if t % 15 == 0 and math.random() > 0.1 then
|
|
|
- -- p.color = starcolors[math.random(#starcolors)]
|
|
|
- -- end
|
|
|
- -- end
|
|
|
- -- end
|
|
|
+ if particletype == 'stars' then
|
|
|
+ for i = 1,#particles do
|
|
|
+ local p = particles[i]
|
|
|
+ if not p.twinkle then goto continueTwinkle end
|
|
|
+ ::continueTwinkle::
|
|
|
+ if t % 15 == 0 and math.random() > 0.1 then
|
|
|
+ p.color = starcolors[math.random(#starcolors)]
|
|
|
+ end
|
|
|
+ end
|
|
|
+ end
|
|
|
if particletype == 'rain' then
|
|
|
for i = 1,#particles do
|
|
|
local p = particles[i]
|
|
|
- if p.last_y then
|
|
|
- trace("particle: " .. i .. ", lasty: " .. p.last_y)
|
|
|
- else
|
|
|
- trace("particle: " .. i .. ", " .. dump(p))
|
|
|
- end
|
|
|
- if p.last_y and p.last_y > 136 then
|
|
|
+ if p.lasty and p.lasty > 136 then
|
|
|
p.y = 0
|
|
|
- p.last_y = 0
|
|
|
+ p.lasty = 0
|
|
|
p.x = math.random() * 240
|
|
|
end
|
|
|
- p.last_y = y
|
|
|
- p.lastx = x
|
|
|
- p.y = p.y + 2
|
|
|
+ p.lasty = p.y
|
|
|
+ p.lastx = p.x
|
|
|
+ p.y = p.y + p.vel
|
|
|
end
|
|
|
end
|
|
|
end
|
|
@@ -484,8 +463,8 @@ function TIC()
|
|
|
end
|
|
|
fade_in(0)
|
|
|
if t==(3*60) or keyp(50) then
|
|
|
- et = 180
|
|
|
- t = et+180
|
|
|
+ et=t
|
|
|
+ t=180
|
|
|
end
|
|
|
if t>(et+(3*60)) and et>=0 then
|
|
|
m=m+1
|
|
@@ -502,13 +481,13 @@ function TIC()
|
|
|
l=5
|
|
|
--REMAP
|
|
|
cls()
|
|
|
+ particleupdate()
|
|
|
+ particledraw()
|
|
|
+
|
|
|
map(30*m%270,17*((m-1)//8),30,17,0,0,0,1)
|
|
|
|
|
|
fade_in(0)
|
|
|
|
|
|
- particleupdate()
|
|
|
- particledraw()
|
|
|
-
|
|
|
if t<0.4*60 then return end
|
|
|
if options.debug then
|
|
|
print("DEBUG: Press X/A and Y/S to switch levels",8,131)
|
|
@@ -534,11 +513,10 @@ function TIC()
|
|
|
fade_in(0)
|
|
|
--REMAP
|
|
|
cls()
|
|
|
- map(30*m%240,17*(m//8),30,17,0,0,0,1)
|
|
|
-
|
|
|
particleupdate()
|
|
|
particledraw()
|
|
|
-
|
|
|
+ map(30*m%240,17*(m//8),30,17,0,0,0,1)
|
|
|
+
|
|
|
--SKULLH LIMITS(1-28,1-14)
|
|
|
--skullh(12,10,0,0)
|
|
|
--if btn(5) then skullh(25,3,0,0) end
|