enchant();
window.onload = function() {
var game = new Game(640, 420);
game.fps = 24;
game.preload(['../images/chara1.gif']);
game.onload = function() {
game.lbl = new Label('');
game.lbl.y = 400;
game.lbl.x = 10;
game.rootScene.addChild(game.lbl);
var tempo = -2000;
var pos = 0;
for(var easing in enchant.Easing) {
tempo +=3000;
pos += 10;
new Bear(pos, tempo, easing);
}
game.rootScene.backgroundColor = 'grey';
};
game.scale=1;
game.debug();
};
Bear = enchant.Class.create(Sprite, {
initialize: function(pos, tempo, easing) {
this.game = enchant.Game.instance;
Sprite.call(this, 32, 32);
this.image = this.game.assets['../images/chara1.gif'];
this.x = 50;
this.y = pos;
this.tl.setTimeBased();
this.tl.delay(tempo).then(function(){this.game.lbl.text=easing;})
.moveTo(550, pos, 3000, enchant.Easing[easing])
.and().rotateTo(90,3000);
this.game.rootScene.addChild(this);
},
});