Hey, im making a simple factory game
a factory will produce 1 material every second
to build one you need 5 materials
a big factory will produce the same but has other benefits
to build one you need 5 factory's
here is my button to make a factory
on(press)
if(materials >= 5)
{
_root.materials = _root.materials -5
_root.factory = _root.factory +1
{
timer1 = function()
{material++}
}
setintervalblabla
}
now after i builded 5 factorys i want another button wich can turn
5 factory's into a big factory
here is that button
on(press)
if(factory >= 5)
{
_root.factory = _root.factory -5
_root.bigfactory = _root.bigfactory +1
{
timer2 = function()
{material++}
}
setintervalblabla
}
this all works i now lost my factory's and got 1 big factory
but...my material output is now 6 every second instead of 1...
so what i tried is clearInterval(timer1Interval)
wich worked i now got only 1 output
now i made some more factory's....but as soon my first factory was up
instead of getting 2 output i got 6-7 output again
the cleared factory's are back to annoy me again.....how do i beat them?
maybe there is something like clearFunction?
or any better/easyer ways to make this kind of a factory game?
or...
thx in advance