2013-04-22 00:53:24 +00:00
|
|
|
/// <reference path="../../Phaser/Game.ts" />
|
|
|
|
/// <reference path="../../Phaser/gameobjects/ScrollZone.ts" />
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
|
|
|
|
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create);
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
|
2013-04-23 14:15:34 +00:00
|
|
|
myGame.loader.addImageFile('crystal', 'assets/pics/jim_sachs_time_crystal.png');
|
2013-04-22 00:53:24 +00:00
|
|
|
|
|
|
|
myGame.loader.load();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function create() {
|
|
|
|
|
2013-04-23 14:15:34 +00:00
|
|
|
// This creates our ScrollZone. It is positioned at x0 y0 (world coodinates) by default and uses
|
|
|
|
// the 'crystal' image from the cache.
|
2013-04-22 00:53:24 +00:00
|
|
|
|
2013-04-23 14:15:34 +00:00
|
|
|
// The default is for the scroll zone to create 1 new scrolling region the size of the whole image you gave it.
|
|
|
|
// For this example we'll keep that, but look at the other tests to see reasons why you may not want to.
|
2013-04-22 00:53:24 +00:00
|
|
|
|
2013-04-23 14:15:34 +00:00
|
|
|
myGame.createScrollZone('crystal').setSpeed(4, 2);
|
2013-04-22 00:53:24 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|