Interesting, although I feel
randomstring(array); might be a bit more useful here (should avoid index stuff):
PHP Code:
function Calculate()
{
this.random = int(random(0,this.alphabet.size()));
if (this.random != this.random_last)
{
this.random_last = this.random;
container_game_text.text = "Press '" @ this.alphabet[this.random] @ "'";
container_game_text.x = 135;
}
else
{
Calculate();
}
}
Something like:
PHP Code:
function calculate()
{
this.random = randomstring(this.alphabet);
if (this.random != this.random_last)
{
this.random_last = temp.letter;
container_game_text.text = format("Press '%s'", this.random);
container_game_text.x = 135;
}
else
{
this.calculate();
}
}
Also, while it's probably nice that you've tried to demonstrate this, it's a bit misleading and probably not that efficient either, since you are running a check twice:
PHP Code:
if (this.container_on ? "On" : "Off" == "On")
Perhaps changing it to standard
true/
false values and using:
PHP Code:
if (this.container_on)