var crateIds = [10, 13, 11, 14, 15, 12]; var platformIds = [ 1, 1, 1, 1, 1, 1]; var deactivateIds = [23, 21, 24, 25, 22, -1]; var activateIds = [20, 23, 21, 24, 25, 22]; var currentObjective = 0;

function initObjective() { addBringCrateToPlatformObjective( crateIds[currentObjective], platformIds[currentObjective]); }

function init() { initObjective(); }

function onCratePickup() { var id = deactivateIds[currentObjective]; if (id != -1) { gameControl.getObjectById(id).deactivate(); } }

function onObjectiveReached() { gameControl.getObjectById(activateIds[currentObjective]).activate(); if (++currentObjective < 6) { initObjective(); } else { gameControl.finish(); } }