Skip to content
Snippets Groups Projects
Commit 7728a382 authored by dg's avatar dg
Browse files

tset

git-svn-id: http://svn.net-core.org/repos/t-engine4@2478 51575b47-30f0-44d4-a5cc-537603b46e54
parent ee959f48
No related branches found
No related tags found
No related merge requests found
Showing
with 120 additions and 7 deletions
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
dir = math.rad(110)
h_per_tick = math.sin(dir)
local first = true
return { generator = function()
local size = rng.float(300, 800)
local x = rng.range(size, width + size)
local y = -size
if first then y = rng.range(size, height - size) end
local vel = rng.float(speed[1], speed[2])
return {
life = (height + size*2) / h_per_tick,
size = rng.float(300, 800), sizev = 0, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = dir, dirv = blur, dira = 0,
vel = vel, velv = 0, vela = 0,
r = 1, rv = 0, ra = 0,
g = 1, gv = 0, ga = 0,
b = 1, bv = 0, ba = 0,
a = rng.float(alpha[1], alpha[2]), av = 0, aa = 0,
}
end, },
function(self)
if first then
self.ps:emit(rng.range(0, max_nb or 1))
first = false
return
end
if rng.chance(chance or 100) then
self.ps:emit(1)
end
end,
max_nb or 1,
particle_name, true
game/modules/tome/data/gfx/weather/grey_cloud_01.png

90.3 KiB

game/modules/tome/data/gfx/weather/grey_cloud_02.png

30.7 KiB

game/modules/tome/data/gfx/weather/grey_cloud_03.png

94.8 KiB

game/modules/tome/data/gfx/weather/grey_cloud_04.png

15.7 KiB

game/modules/tome/data/gfx/weather/grey_cloud_05.png

84.4 KiB

game/modules/tome/data/gfx/weather/grey_cloud_06.png

105 KiB

game/modules/tome/data/gfx/weather/grey_cloud_07.png

107 KiB

game/modules/tome/data/gfx/weather/sand_light_01.png

61.4 KiB

game/modules/tome/data/gfx/weather/sand_light_02.png

22 KiB

game/modules/tome/data/gfx/weather/sand_light_03.png

66.7 KiB

game/modules/tome/data/gfx/weather/sand_light_04.png

13.5 KiB

game/modules/tome/data/gfx/weather/sand_light_05.png

62.4 KiB

game/modules/tome/data/gfx/weather/sand_light_06.png

76.3 KiB

game/modules/tome/data/gfx/weather/sand_light_07.png

74.7 KiB

......@@ -297,7 +297,7 @@ return {
local newRank = math.floor(game.level.arena.rank)
if currentRank < newRank then --Player's rank increases!
local x, y = game.level.map:getTileToScreen(game.player.x, game.player.y)
if newRank == 9 then world:gainAchievement("XXX_THE_DESTROYER", game.player)
if newRank == 10 then world:gainAchievement("XXX_THE_DESTROYER", game.player)
elseif newRank == 21 then world:gainAchievement("GRAND_MASTER", game.player)
end
game.flyers:add(x, y, 90, 0, -0.5, "RANK UP!!", { 2, 57, 185 }, true)
......
......@@ -78,4 +78,31 @@ return {
}, },
},
},
post_process = function(level)
local Map = require "engine.Map"
local Particles = require("engine.Particles")
local ps = {}
ps[#ps+1] = Particles.new("weather_storm", 1, {width=Map.viewport.width, height=Map.viewport.height, speed={10, 40}, alpha={0.3, 0.6}, particle_name="weather/sand_light_01"})
ps[#ps+1] = Particles.new("weather_storm", 1, {width=Map.viewport.width, height=Map.viewport.height, speed={10, 40}, alpha={0.3, 0.6}, particle_name="weather/sand_light_02"})
ps[#ps+1] = Particles.new("weather_storm", 1, {width=Map.viewport.width, height=Map.viewport.height, speed={10, 40}, alpha={0.3, 0.6}, particle_name="weather/sand_light_03"})
ps[#ps+1] = Particles.new("weather_storm", 1, {width=Map.viewport.width, height=Map.viewport.height, speed={10, 40}, alpha={0.3, 0.6}, particle_name="weather/sand_light_04"})
ps[#ps+1] = Particles.new("weather_storm", 1, {width=Map.viewport.width, height=Map.viewport.height, speed={10, 40}, alpha={0.3, 0.6}, particle_name="weather/sand_light_05"})
ps[#ps+1] = Particles.new("weather_storm", 1, {width=Map.viewport.width, height=Map.viewport.height, speed={10, 40}, alpha={0.3, 0.6}, particle_name="weather/sand_light_06"})
ps[#ps+1] = Particles.new("weather_storm", 1, {width=Map.viewport.width, height=Map.viewport.height, speed={10, 40}, alpha={0.3, 0.6}, particle_name="weather/sand_light_07"})
level.foreground_particle = ps
end,
foreground = function(level, x, y, nb_keyframes)
local Map = require "engine.Map"
local ps = level.foreground_particle
for j = 1, #ps do
for i = 1, nb_keyframes do
ps[j]:update()
ps[j].ps:update()
end
ps[j].ps:toScreen(x, y, true, 1)
end
end,
}
......@@ -90,8 +90,8 @@ return {
for i = 1, nb_keyframes do
level.foreground_particle:update()
if i == 1 then level.foreground_particle.ps:toScreen(x, y, true, 1) end
level.foreground_particle.ps:update()
end
level.foreground_particle.ps:toScreen(x, y, true, 1)
end,
}
......@@ -61,8 +61,8 @@ return {
for i = 1, nb_keyframes do
level.background_particle:update()
if i == 1 then level.background_particle.ps:toScreen(x, y, true, 1) end
level.background_particle.ps:update()
end
level.background_particle.ps:toScreen(x, y, true, 1)
end,
}
......@@ -66,10 +66,6 @@ return {
nb_trap = {6, 9},
},
},
post_process = function(level)
-- Place a lore note on each level
game:placeRandomLoreObject("NOTE"..level.level)
end,
levels =
{
[1] = {
......@@ -78,4 +74,35 @@ return {
}, },
},
},
post_process = function(level)
-- Place a lore note on each level
game:placeRandomLoreObject("NOTE"..level.level)
local Map = require "engine.Map"
local Particles = require("engine.Particles")
local ps = {}
ps[#ps+1] = Particles.new("weather_storm", 1, {max_nb=5, width=level.map.w*level.map.tile_w, height=level.map.h*level.map.tile_h, speed={0.5, 1.6}, alpha={0.23, 0.35}, particle_name="weather/grey_cloud_01"})
ps[#ps+1] = Particles.new("weather_storm", 1, {max_nb=5, width=level.map.w*level.map.tile_w, height=level.map.h*level.map.tile_h, speed={0.5, 1.6}, alpha={0.23, 0.35}, particle_name="weather/grey_cloud_02"})
ps[#ps+1] = Particles.new("weather_storm", 1, {max_nb=5, width=level.map.w*level.map.tile_w, height=level.map.h*level.map.tile_h, speed={0.5, 1.6}, alpha={0.23, 0.35}, particle_name="weather/grey_cloud_03"})
ps[#ps+1] = Particles.new("weather_storm", 1, {max_nb=5, width=level.map.w*level.map.tile_w, height=level.map.h*level.map.tile_h, speed={0.5, 1.6}, alpha={0.23, 0.35}, particle_name="weather/grey_cloud_04"})
ps[#ps+1] = Particles.new("weather_storm", 1, {max_nb=5, width=level.map.w*level.map.tile_w, height=level.map.h*level.map.tile_h, speed={0.5, 1.6}, alpha={0.23, 0.35}, particle_name="weather/grey_cloud_05"})
ps[#ps+1] = Particles.new("weather_storm", 1, {max_nb=5, width=level.map.w*level.map.tile_w, height=level.map.h*level.map.tile_h, speed={0.5, 1.6}, alpha={0.23, 0.35}, particle_name="weather/grey_cloud_06"})
ps[#ps+1] = Particles.new("weather_storm", 1, {max_nb=5, width=level.map.w*level.map.tile_w, height=level.map.h*level.map.tile_h, speed={0.5, 1.6}, alpha={0.23, 0.35}, particle_name="weather/grey_cloud_07"})
level.foreground_particle = ps
end,
foreground = function(level, x, y, nb_keyframes)
local Map = require "engine.Map"
local ps = level.foreground_particle
local dx, dy = level.map:getTileToScreen(0, 0) -- Display at map border, always, so it scrolls with the map
for j = 1, #ps do
for i = 1, nb_keyframes do
ps[j]:update()
ps[j].ps:update()
end
ps[j].ps:toScreen(dx, dy, true, 1)
end
end,
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment