1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
{
id: "spawn_timing_test",
always_active: true,
vars: {
numToSpawn: 500,
numSpawned: 0,
},
on_create: "[
debug('Spawning #{numSpawned}/{numToSpawn}.'),
if(numSpawned < numToSpawn, add_object(ob))
] where ob = object(self.type, numSpawned%50*img_w, numSpawned/50*img_h, 1, {'numSpawned' -> numSpawned + 1})",
on_end_anim: "animation('normal')",
animation: {
id: "normal",
image: "experimental/spiderbot.png",
rect: [87,75,94,82],
pad: 0,
frames: 2,
duration: 5,
item_area: "all",
},
}
|