My sewers need broken lights that flash at random intervals. Nothing strobe-like, more like a bug zapper (it would be great if I could include sparks as well) or a very broken flourescent light.
How can I achieve this?
Here is the code for flashing lights:
local delay = {}
local init_delay = {}
local on = {}
local last_state = 1
function light_flash_init(e)
--change delay here to adjust flash timing
delay[e] = 333
init_delay[e] = delay[e]
if last_state == 0 then
last_state = 1
else
last_state = 0
end
on[e] = last_state
end
function light_flash_main(e)
if GetTimer(e) > delay[e] then
if on[e] == 0 then
on[e] = 1
ShowLight(e)
else
on[e] = 0
HideLight(e)
end
delay[e] = GetTimer(e) + init_delay[e]
end
end
Does Game Guru (lua) have a random number generator? Or would I do this in AGK2 in code?
I need this to work in AGK2 tier 1 as well - since I will be porting all levels to AGK2.
Thank you.
Mike
YOU DREAM IT - WE CREATE IT!
www.atomiccatinteractive.com
For world-class virtual instruments - www.supersynths.com