Saving first iteration of the ScrollZone game object.

This commit is contained in:
Richard Davey
2013-04-22 01:53:24 +01:00
parent 2638e598dc
commit f2678104fa
43 changed files with 13711 additions and 857 deletions
+10 -15
View File
@@ -1,3 +1,4 @@
/// <reference path="../../Phaser/gameobjects/Tilemap.ts" />
/// <reference path="../../Phaser/Game.ts" />
(function () {
@@ -7,7 +8,8 @@
function init() {
// Tiled JSON Test
myGame.loader.addTextFile('jsontest', 'assets/maps/test.json');
//myGame.loader.addTextFile('jsontest', 'assets/maps/test.json');
myGame.loader.addTextFile('jsontest', 'assets/maps/multi-layer-test.json');
myGame.loader.addImageFile('jsontiles', 'assets/tiles/platformer_tiles.png');
// CSV Test
@@ -28,24 +30,17 @@
myGame.camera.deadzone = new Phaser.Rectangle(64, 64, myGame.stage.width - 128, myGame.stage.height - 128);
bigCam = myGame.createCamera(30, 30, 200, 200);
bigCam.showBorder = true;
bigCam.scale.setTo(1.5, 1.5);
//bigCam = myGame.createCamera(30, 30, 200, 200);
//bigCam.showBorder = true;
//bigCam.scale.setTo(1.5, 1.5);
//map = myGame.createTilemap('jsontiles', 'jsontest', Tilemap.FORMAT_TILED_JSON);
map = myGame.createTilemap('csvtiles', 'csvtest', Phaser.Tilemap.FORMAT_CSV, 16, 16);
// for now like this, but change to auto soon
myGame.world.setSize(map.widthInPixels, map.heightInPixels);
console.log('world size', map.widthInPixels, map.heightInPixels);
myGame.camera.setBounds(0, 0, myGame.world.width, myGame.world.height);
bigCam.setBounds(0, 0, myGame.world.width, myGame.world.height);
//map = myGame.createTilemap('jsontiles', 'jsontest', Phaser.Tilemap.FORMAT_TILED_JSON);
map = myGame.createTilemap('csvtiles', 'csvtest', Phaser.Tilemap.FORMAT_CSV, true, 16, 16);
car = myGame.createSprite(300, 100, 'car');
myGame.camera.follow(car);
bigCam.follow(car, Phaser.Camera.STYLE_LOCKON);
//bigCam.follow(car, Phaser.Camera.STYLE_LOCKON);
myGame.onRenderCallback = render;
@@ -80,7 +75,7 @@
function render {
map.renderDebugInfo(400, 16);
//map.renderDebugInfo(400, 16);
}