#include "scripts\base.inc"
Initialize();
method Initialize()
{
this.DropObjects = new Array();
this. frames = 0;
}
method Update()
{
this.frames = this.frames + 1;
var drop_array = this.DropObjects;
// create objects at frames 2 and 4
if (2 == this.frames)
{
Game.LOG("creating toto1");
var toto1 = new Object("scenes\Room\scr\bogus.script");
drop_array.Push(toto1);
}
else if (4 == this.frames)
{
Game.LOG("creating toto2");
var toto2 = new Object("scenes\Room\scr\bogus.script");
drop_array.Push(toto2);
}
var j;
var cur_drop;
for (j = 0 ; j < drop_array.Length ; j = j+1 )
{
cur_drop = drop_array[j];
// In real life we would do something with cur_drop
// but to make the runtime crash we simply need to reference it.
}
// print the content of drop_array
Game.LOG("frame num " + this.frames);
Game.LOG("Size and content of drop_array:");
Game.LOG(drop_array.Length);
var i;
for (i = 0 ; i < drop_array.Length ; i = i+1 )
Game.LOG(drop_array[i]);
}