mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
Lunatic: in test/helixspawner.lua, make COLOR a global variable. DONT_BUILD.
To demonstrate and test that it can be modified from outside, and that these changes are kept with savegame restores. git-svn-id: https://svn.eduke32.com/eduke32@5322 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0dc20f913c
commit
ae56faf0ad
1 changed files with 5 additions and 5 deletions
|
@ -28,6 +28,9 @@ local nukeswStart = con.actorvar(false)
|
|||
-- "volatile" actors.
|
||||
local starPal = con.actorvar(0)
|
||||
|
||||
-- Color per decasecond, can be changed from outside.
|
||||
COLOR = { 1, 2, 6, 7, 8 }
|
||||
|
||||
require("end_gamevars")
|
||||
|
||||
|
||||
|
@ -38,9 +41,6 @@ local angvec = xmath.angvec
|
|||
local D = require("CON.DEFS")
|
||||
local GTICSPERSEC = gv.GTICSPERSEC
|
||||
|
||||
-- color per decasecond
|
||||
local COLOR = { 1, 2, 6, 7, 8 }
|
||||
|
||||
gameactor
|
||||
{
|
||||
D.TRANSPORTERSTAR+4,
|
||||
|
@ -59,14 +59,14 @@ gameactor
|
|||
if (act:has_action(0)) then
|
||||
act:set_action(1) -- TODO: actor constructors, i.e. 'init' callbacks
|
||||
|
||||
local decasec = math.floor((gv.gametic - nukeswStart[spr.owner])/(GTICSPERSEC*10))
|
||||
local decasec = math.floor((gv.gametic - nukeswStart[spr.owner])/(GTICSPERSEC*10)) % 12
|
||||
|
||||
local pal = COLOR[decasec+1]
|
||||
if (pal ~= nil) then
|
||||
starPal[aci] = pal
|
||||
end
|
||||
|
||||
-- At one point, we stop coloring the spawned stars. This tests
|
||||
-- Every 2nd minute, we stop coloring the spawned stars. This tests
|
||||
-- per-actor variable resetting to the default value.
|
||||
spr.pal = starPal[aci]
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue