Tilemap Rendering is working :)

This commit is contained in:
Richard Davey
2013-09-12 00:55:27 +01:00
parent 95374339b9
commit 89b00db103
17 changed files with 197 additions and 49 deletions
+14 -1
View File
@@ -26,6 +26,14 @@
}
var canvas;
var context;
var baseTexture;
var texture;
var s;
var r;
var t;
function create() {
// game, key, mapData, format, resizeWorld, tileWidth, tileHeight
@@ -33,12 +41,17 @@
// This creates the tilemap using the csv and tile sheet we loaded.
// We tell it use to CSV format parser. The 16x16 are the tile sizes.
// The 4th parameter (true) tells the game world to resize itself based on the map dimensions or not.
var t = new Phaser.Tilemap(game, 'csvtiles', 'csvtest', Phaser.Tilemap.FORMAT_CSV, true, 16, 16);
t = new Phaser.Tilemap(game, 'csvtiles', 'csvtest', Phaser.Tilemap.FORMAT_CSV, true, 16, 16);
r = new Phaser.TilemapRenderer(game);
}
function update() {
r.render(t);
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
{
game.camera.x -= 4;