|
@@ -125,12 +125,15 @@ function fade_in(et)
|
|
end
|
|
end
|
|
|
|
|
|
-- PARTICLE/VFX STUFF
|
|
-- PARTICLE/VFX STUFF
|
|
-waterlevel = 120 -- y coordinate of the water
|
|
|
|
-particletype='snow' -- snow|rain|stars
|
|
|
|
particles = {}
|
|
particles = {}
|
|
|
|
+particletype = 'stars'
|
|
local starcolors = { 1, 2, 13, 15}
|
|
local starcolors = { 1, 2, 13, 15}
|
|
-function particleinit(numparticles)
|
|
|
|
|
|
+-- numparticles = number of particles to show
|
|
|
|
+-- particletype = rain|snow|stars
|
|
|
|
+function particleinit(numparticles, type)
|
|
-- initialize
|
|
-- initialize
|
|
|
|
+ particles = {}
|
|
|
|
+ particletype = type
|
|
for i = 0, numparticles do
|
|
for i = 0, numparticles do
|
|
table.insert(particles, {
|
|
table.insert(particles, {
|
|
x = math.random() * 240,
|
|
x = math.random() * 240,
|
|
@@ -151,6 +154,9 @@ function particleinit(numparticles)
|
|
if particletype == 'rain' then
|
|
if particletype == 'rain' then
|
|
for i = 1, #particles do
|
|
for i = 1, #particles do
|
|
particles[i].vel = math.random(3) + 1
|
|
particles[i].vel = math.random(3) + 1
|
|
|
|
+ if particles[i].vel > 2.5 then
|
|
|
|
+ particles[i].color = 8
|
|
|
|
+ end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
if particletype == 'snow' then
|
|
if particletype == 'snow' then
|
|
@@ -181,8 +187,9 @@ function particleupdate()
|
|
p.x = math.random() * 240
|
|
p.x = math.random() * 240
|
|
end
|
|
end
|
|
p.lasty = p.y
|
|
p.lasty = p.y
|
|
- p.lastx = p.x
|
|
|
|
- p.y = p.y + p.vel
|
|
|
|
|
|
+ p.lastx = p.x
|
|
|
|
+ p.x = p.x - p.vel / 5
|
|
|
|
+ p.y = p.y + p.vel * 1.5
|
|
end
|
|
end
|
|
end
|
|
end
|
|
if particletype == 'snow' then
|
|
if particletype == 'snow' then
|
|
@@ -193,7 +200,7 @@ function particleupdate()
|
|
p.lasty = 0
|
|
p.lasty = 0
|
|
p.x = math.random() * 240
|
|
p.x = math.random() * 240
|
|
end
|
|
end
|
|
- p.x = p.x + (math.random() - 0.5)
|
|
|
|
|
|
+ p.x = p.x - (math.random() - 0.4)
|
|
p.y = p.y + p.vel
|
|
p.y = p.y + p.vel
|
|
end
|
|
end
|
|
end
|
|
end
|
|
@@ -203,7 +210,7 @@ function particledraw()
|
|
if (particletype == 'rain') then
|
|
if (particletype == 'rain') then
|
|
for i = 1,#particles do
|
|
for i = 1,#particles do
|
|
local p = particles[i]
|
|
local p = particles[i]
|
|
- line(p.x, p.y, p.lastx, p.lasty, color)
|
|
|
|
|
|
+ line(p.x, p.y, p.lastx, p.lasty, p.color)
|
|
end
|
|
end
|
|
return
|
|
return
|
|
end
|
|
end
|
|
@@ -213,7 +220,8 @@ function particledraw()
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
-particleinit(150)
|
|
|
|
|
|
+-- init here for title screen
|
|
|
|
+particleinit(150, 'stars')
|
|
|
|
|
|
--(shx: Xpos, shy: Ypos, shf: flip, sht: timer) CHECK THIS
|
|
--(shx: Xpos, shy: Ypos, shf: flip, sht: timer) CHECK THIS
|
|
function skullh(shx,shy,shf,sht)
|
|
function skullh(shx,shy,shf,sht)
|
|
@@ -258,12 +266,14 @@ function level(m)
|
|
et=-255
|
|
et=-255
|
|
strig=0
|
|
strig=0
|
|
ftrig=0
|
|
ftrig=0
|
|
|
|
+ t=0
|
|
|
|
+
|
|
|
|
+ if m <= 2 then
|
|
|
|
+ particleinit(150, 'stars')
|
|
|
|
+ else
|
|
|
|
+ particleinit(120, 'rain')
|
|
|
|
+ end
|
|
|
|
|
|
- --HELLO WORLD, PERFECT REFLECT, END
|
|
|
|
- if m==2 or m==12 or m==22 then
|
|
|
|
- t=0
|
|
|
|
- end
|
|
|
|
-
|
|
|
|
if m > 0 then
|
|
if m > 0 then
|
|
local data = leveldata[m]
|
|
local data = leveldata[m]
|
|
s = data.s
|
|
s = data.s
|