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

dust trail

git-svn-id: http://svn.net-core.org/repos/t-engine4@4637 51575b47-30f0-44d4-a5cc-537603b46e54
parent 6d90c0de
No related branches found
No related tags found
No related merge requests found
......@@ -688,6 +688,9 @@ end
--- Called after running a step
function _M:runMoved()
self:playerFOV()
if self.running and self.running.explore then
game.level.map:particleEmitter(self.x, self.y, 1, "dust_trail")
end
end
--- Called after stopping running
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011 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
base_size = 32
return { generator = function()
-- Make a random palette from light brown, dark brown, green, and black.
-- This lets us avoid "weird" colors like yellow, orange, and blue, and
-- these particles should still be clearly visible over a variety of terrain.
local r1 = rng.float(0, 1)
local r2 = rng.float(0, 1)
local r3 = rng.float(0, 0.5)
local r4 = rng.float(0, 1.5)
local tot = r1 + r2 + r3 + r4
r1 = r1 / tot
r2 = r2 / tot
r3 = r3 / tot
return {
trail = 1,
life = rng.range(35, 50),
size = rng.float(2, 3), sizev = 0, sizea = 0,
x = rng.range(-12, 12), xv = rng.float(-0.3, 0.3), xa = 0,
y = rng.range(-10, 16), yv = rng.float(-0.5, -0.3), ya = 0.02,
dir = 0, dirv = 0, dira = 0,
vel = 0.0, velv = 0, vela = 0,
r = r1*0.55 + r2*0.42 + r3*0.10, rv = 0, ra = 0,
g = r1*0.45 + r2*0.26 + r3*0.55, gv = 0, ga = 0,
b = r1*0.33 + r2*0.15 + r3*0.10, bv = 0, ba = 0,
a = 1.0, av = 0, aa = -0.0006,
}
end, },
function(self)
self.nb = (self.nb or 0) + 1
if self.nb < 30 then
self.ps:emit(6)
end
end,
40
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