var Task = Container.expand(function () {
var self = Container.call(this);
var taskGraphics = self.createAsset('task', 'Task Graphics', .5, .5);
self.move = function () {};
self.update = function () {};
});
var TeamChallenge = Container.expand(function () {
var self = Container.call(this);
var challengeGraphics = self.createAsset('challenge', 'Challenge Graphics', .5, .5);
self.move = function () {};
self.update = function () {};
});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.createAsset('player', 'Player Graphics', .5, .5);
self.move = function () {};
self.update = function () {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
LK.stageContainer.setBackgroundColor(0x008080);
var tasks = [];
var challenges = [];
var player = self.addChild(new Player());
player.x = 2048 / 2;
player.y = 2732 / 2;
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
LK.setScore(0);
scoreTxt.setText(0);
scoreTxt.anchor.set(.5, 0);
LK.gui.topCenter.addChild(scoreTxt);
var timer = LK.setInterval(function () {});
stage.on('down', function (obj) {
var event = obj.event;
var pos = event.getLocalPosition(self);
player.x = pos.x;
player.y = pos.y;
});
LK.on('tick', function () {
player.update();
for (var a = tasks.length; a >= 0; a--) {
tasks[a].move();
if (tasks[a].y < -50) {
tasks[a].destroy();
tasks.splice(a, 1);
}
}
for (var b = challenges.length; b >= 0; b--) {
challenges[b].move();
if (challenges[b].y < -50) {
challenges[b].destroy();
challenges.splice(b, 1);
}
}
});
});