var Branch = Container.expand(function () { var self = Container.call(this); var branchGraphics = self.createAsset('branch', 'Branch Graphics', .5, .5); self.move = function () {}; self.update = function () {}; }); var Bird = Container.expand(function () { var self = Container.call(this); var birdGraphics = self.createAsset('bird', 'Bird Graphics', .5, .5); self.move = function () {}; self.update = function () {}; }); var Monkey = Container.expand(function () { var self = Container.call(this); var monkeyGraphics = self.createAsset('monkey', 'Monkey Graphics', .5, .5); self.jump = function () {}; self.update = function () {}; }); var Game = Container.expand(function () { var self = Container.call(this); var branches = []; var birds = []; var monkey = self.addChild(new Monkey()); monkey.x = 1024; monkey.y = 2732 - monkey.height; LK.on('tick', function () { monkey.update(); for (var i = 0; i < branches.length; i++) { branches[i].update(); if (branches[i].y > 2732) { branches[i].destroy(); branches.splice(i, 1); i--; } } for (var i = 0; i < birds.length; i++) { birds[i].update(); if (birds[i].y > 2732) { birds[i].destroy(); birds.splice(i, 1); i--; } } if (LK.ticks % 60 == 0) { var newBranch = new Branch(); newBranch.x = Math.random() * 2048; newBranch.y = 0; branches.push(newBranch); self.addChild(newBranch); var newBird = new Bird(); newBird.x = Math.random() * 2048; newBird.y = 0; birds.push(newBird); self.addChild(newBird); } for (var i = 0; i < branches.length; i++) { if (monkey.intersects(branches[i])) { monkey.jump(); } } for (var i = 0; i < birds.length; i++) { if (monkey.intersects(birds[i])) { LK.showGameOver(); } } }); stage.on('down', function (obj) { var pos = obj.event.getLocalPosition(self); if (pos.y < monkey.y) { monkey.jump(); } }); });
var Branch = Container.expand(function () {
var self = Container.call(this);
var branchGraphics = self.createAsset('branch', 'Branch Graphics', .5, .5);
self.move = function () {};
self.update = function () {};
});
var Bird = Container.expand(function () {
var self = Container.call(this);
var birdGraphics = self.createAsset('bird', 'Bird Graphics', .5, .5);
self.move = function () {};
self.update = function () {};
});
var Monkey = Container.expand(function () {
var self = Container.call(this);
var monkeyGraphics = self.createAsset('monkey', 'Monkey Graphics', .5, .5);
self.jump = function () {};
self.update = function () {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
var branches = [];
var birds = [];
var monkey = self.addChild(new Monkey());
monkey.x = 1024;
monkey.y = 2732 - monkey.height;
LK.on('tick', function () {
monkey.update();
for (var i = 0; i < branches.length; i++) {
branches[i].update();
if (branches[i].y > 2732) {
branches[i].destroy();
branches.splice(i, 1);
i--;
}
}
for (var i = 0; i < birds.length; i++) {
birds[i].update();
if (birds[i].y > 2732) {
birds[i].destroy();
birds.splice(i, 1);
i--;
}
}
if (LK.ticks % 60 == 0) {
var newBranch = new Branch();
newBranch.x = Math.random() * 2048;
newBranch.y = 0;
branches.push(newBranch);
self.addChild(newBranch);
var newBird = new Bird();
newBird.x = Math.random() * 2048;
newBird.y = 0;
birds.push(newBird);
self.addChild(newBird);
}
for (var i = 0; i < branches.length; i++) {
if (monkey.intersects(branches[i])) {
monkey.jump();
}
}
for (var i = 0; i < birds.length; i++) {
if (monkey.intersects(birds[i])) {
LK.showGameOver();
}
}
});
stage.on('down', function (obj) {
var pos = obj.event.getLocalPosition(self);
if (pos.y < monkey.y) {
monkey.jump();
}
});
});
A tree branch with green leaves Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A preying white bird flying ahead Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A cute monkey with arms up Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Wood texture Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Bananas Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Cartoony looking spider, with two big round eyes Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
One green vine Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.