Created
October 24, 2012 09:14
-
-
Save yonekawa/3945014 to your computer and use it in GitHub Desktop.
Leak code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enchant(); | |
var NewScene = enchant.Class.create(enchant.Scene, { | |
initialize: function() { | |
enchant.Scene.call(this); | |
for (var i = 0; i < 100; i++) { | |
var sprite = new Sprite(32, 32); | |
sprite.image = enchant.Game.instance.assets['chara1.png']; | |
this.addChild(sprite); | |
} | |
} | |
}); | |
window.onload = function(){ | |
var game = new Game(320, 320); | |
game.preload("chara1.png"); | |
game.onload = function() { | |
var bear = new Sprite(32, 32); | |
bear.image = game.assets['chara1.png']; | |
game.rootScene.addChild(bear); | |
bear.tl.moveTo(200, 200, 30).moveTo(-200, -200, 30).loop(); | |
game.rootScene.on('touchstart', function() { | |
for (var i = 0; i < 100; i++) { | |
var newScene = new NewScene(); | |
game.pushScene(newScene); | |
game.popScene(); | |
} | |
}); | |
}; | |
game.start(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment