“Tipsy Tower” HTML5 prototype made with Panda 2 – a powerful JavaScript based game development platform
Talking about Tipsy Tower game, Game development, HTML5, Javascript and Reviews.
Learn cross platform HTML5 game development
Check my Gumroad page for commented source code, games and books.

game.module(
'game.main'
)
.require(
'plugin.p2'
)
.body(function() {
game.addAsset('crate.png');
game.addAsset('ground.png');
game.createScene('Main', {
backgroundColor: '#003a72',
canDrop: true,
crates: [],
init: function() {
this.world = new game.Physics();
var ground = new game.PhysicsSprite('ground.png', game.width / 2, 960);
ground.addTo(this.stage);
this.moving = new game.Sprite('crate.png');
this.moving.anchorCenter();
this.moving.position.set(77);
game.Tween.add(this.moving.position, {
x: game.width - this.moving.width
}, 1300, {
repeat: Infinity,
yoyo: true
}).start();
this.moving.addTo(this.stage);
},
mousedown: function() {
if (!this.canDrop) return;
this.canDrop = false;
this.moving.visible = false;
var crate = new game.PhysicsSprite('crate.png', this.moving.x, this.moving.y, {
mass: 1
});
crate.addTo(this.stage);
this.crates.push(crate);
game.Timer.add(500, this.reset.bind(this));
},
reset: function() {
this.canDrop = true;
this.moving.visible = true;
},
update: function() {
for (var i = this.crates.length - 1; i >= 0; i--) {
if (this.crates[i].y > game.height + this.crates[i].height) {
this.crates[i].remove();
this.crates.splice(i, 1);
}
}
}
});
});
Never miss an update! Subscribe, and I will bother you by email only when a new game or full source code comes out.