mirror of
https://github.com/photonstorm/phaser
synced 2024-11-30 16:39:34 +00:00
34 lines
1 KiB
TypeScript
34 lines
1 KiB
TypeScript
/// <reference path="../../Phaser/Game.ts" />
|
|
/// <reference path="../../Phaser/gameobjects/ScrollZone.ts" />
|
|
|
|
(function () {
|
|
|
|
var game = new Phaser.Game(this, 'game', 800, 600, preload, create);
|
|
|
|
function preload() {
|
|
|
|
game.load.image('balls', 'assets/sprites/balls.png');
|
|
|
|
|
|
}
|
|
|
|
var leftFace: Phaser.ScrollZone;
|
|
var rightFace: Phaser.ScrollZone;
|
|
var topFace: Phaser.ScrollZone;
|
|
|
|
function create() {
|
|
|
|
topFace = game.add.scrollZone('balls', 200, 0, 204, 204).setSpeed(0, 2.2);
|
|
topFace.transform.skew.setTo(0, Math.tan(game.math.radiansToDegrees(-30)));
|
|
topFace.transform.scale.setTo(1, 1.3);
|
|
|
|
leftFace = game.add.scrollZone('balls', 110, 264, 204, 204).setSpeed(0, 2.1);
|
|
leftFace.transform.skew.setTo(0, Math.tan(game.math.radiansToDegrees(30)));
|
|
|
|
rightFace = game.add.scrollZone('balls', 200, 466, 204, 204).setSpeed(0, 2);
|
|
rightFace.transform.skew.setTo(0, Math.tan(game.math.radiansToDegrees(-30)));
|
|
rightFace.transform.scale.setTo(1, 0.8);
|
|
|
|
}
|
|
|
|
})();
|