mirror of
https://github.com/wassname/phaser.git
synced 2026-10-29 13:21:16 +08:00
Tileset working, map coming next.
This commit is contained in:
1 parent
b868c2cb1b
commit
cf414394c3
12 files changed
+7427
-71
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 75 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,39 @@
|
||||
{ "height":44,
|
||||
"layers":[
|
||||
{
|
||||
"data":[1, 2, 3, 4, 1, 4, 3, 4, 1, 2, 5, 6, 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 1, 2, 3, 6, 1, 2, 3, 6, 5, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 3, 6, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 8, 8, 8, 8, 8, 8, 8, 5, 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 3, 6, 1, 2, 3, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 2, 3, 6, 1, 2, 1, 2, 3, 6, 1, 2, 3, 6, 11, 1, 1, 12, 9, 4, 9, 4, 9, 4, 9, 10, 13, 14, 15, 14, 14, 15, 14, 15, 16, 17, 14, 14, 16, 17, 15, 14, 15, 14, 15, 14, 5, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 12, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 10, 9, 9, 9, 9, 13, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 18, 19, 20, 7, 7, 16, 17, 7, 7, 7, 7, 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7, 11, 6, 6, 5, 7, 7, 7, 7, 24, 25, 26, 7, 7, 7, 7, 7, 7, 7, 7, 7, 40, 7, 7, 7, 40, 7, 7, 7, 5, 1, 2, 3, 6, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 12, 9, 9, 9, 9, 22, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 40, 16, 17, 40, 7, 7, 32, 32, 32, 32, 32, 32, 5, 6, 6, 12, 9, 9, 9, 9, 9, 13, 7, 7, 7, 7, 7, 7, 7, 11, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 2, 3, 6, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 11, 1, 1, 5, 7, 7, 7, 7, 41, 42, 43, 44, 45, 44, 45, 44, 45, 44, 45, 44, 16, 17, 44, 45, 16, 17, 45, 44, 5, 1, 2, 3, 6, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 1, 2, 3, 6, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 45, 44, 45, 44, 45, 44, 45, 44, 45, 44, 12, 9, 9, 10, 9, 10, 9, 10, 9, 10, 22, 32, 5, 1, 1, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 11, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 2, 3, 6, 5, 7, 7, 7, 7, Line truncated
|
||||
"height":44,
|
||||
"name":"ShoeBox Tile Grab",
|
||||
"opacity":1,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":160,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"orientation":"orthogonal",
|
||||
"properties":
|
||||
{
|
||||
|
||||
},
|
||||
"tileheight":16,
|
||||
"tilesets":[
|
||||
{
|
||||
"firstgid":1,
|
||||
"image":"CybernoidMap3BG_bank.png",
|
||||
"imageheight":128,
|
||||
"imagewidth":176,
|
||||
"margin":0,
|
||||
"name":"CybernoidMap3BG_bank.png",
|
||||
"properties":
|
||||
{
|
||||
|
||||
},
|
||||
"spacing":0,
|
||||
"tileheight":16,
|
||||
"tilewidth":16
|
||||
}],
|
||||
"tilewidth":16,
|
||||
"version":1,
|
||||
"width":160
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
+15
-21
@@ -10,18 +10,8 @@
|
||||
|
||||
function preload() {
|
||||
|
||||
// game.load.image('snes', 'assets/maps/smb_tiles.png');
|
||||
// game.load.tilemap('nes', 'assets/maps/mario1.png', 'assets/maps/mario1.json', null, Phaser.Tilemap.JSON);
|
||||
// game.load.tilemap('snes', 'assets/maps/smb_tiles.png', 'assets/maps/smb_level1.json', null, Phaser.Tilemap.JSON);
|
||||
|
||||
// Just loads the level data and specifies the format
|
||||
// game.load.tilemap('marioLevel1', 'assets/maps/smb_level1.json', Phaser.Tilemap.JSON);
|
||||
|
||||
// What about passing in a JSON object though? Need that too. But a CSV would look like a 'string', not an object - how to tell apart from URL?
|
||||
// game.load.tilemap('marioLevel1', SMB_LEVEL_JSON, Phaser.Tilemap.JSON);
|
||||
|
||||
// Exactly the same as loading a sprite sheet :)
|
||||
game.load.tileset('marioLevel1', 'assets/maps/smb_tiles.png', 32, 32);
|
||||
game.load.tilemap('cybernoidLevel3', 'assets/maps/cybernoid.json', null, Phaser.Tilemap.JSON);
|
||||
game.load.tileset('cybernoidTiles', 'assets/maps/cybernoid.png', 16, 16);
|
||||
|
||||
}
|
||||
|
||||
@@ -33,28 +23,32 @@
|
||||
|
||||
|
||||
|
||||
layer = new Phaser.TilemapLayer(game, 0, 0, 500, 500, [], 'snes');
|
||||
// layer = new Phaser.TilemapLayer(game, 0, 0, 500, 500, [], 'snes');
|
||||
|
||||
// layer = new Phaser.TilemapLayer(game, 0, 0, 500, 500);
|
||||
|
||||
|
||||
// layer.load(mapData, tileset);
|
||||
// layer.create(mapWidth, mapHeight, [tileset]);
|
||||
// layer.updateTileset(key); // can change on the fly
|
||||
|
||||
layer.context.fillStyle = 'rgb(255,0,0)';
|
||||
layer.context.fillRect(0, 0, 200, 300);
|
||||
// layer.updateTileset('cybernoidTiles'); // can change on the fly
|
||||
|
||||
|
||||
// layer.context.fillStyle = 'rgb(255,0,0)';
|
||||
// layer.context.fillRect(0, 0, 200, 300);
|
||||
|
||||
/*
|
||||
game.world._container.addChild(layer.sprite);
|
||||
|
||||
layer.create(10, 10);
|
||||
|
||||
layer.putTile(2, 2, 1);
|
||||
layer.putTile(3, 2, 1);
|
||||
layer.putTile(4, 2, 1);
|
||||
layer.putTile(5, 2, 1);
|
||||
layer.putTile(4, 6, 1);
|
||||
layer.putTile(0, 0, 3);
|
||||
layer.putTile(0, 1, 4);
|
||||
|
||||
layer.render();
|
||||
|
||||
layer.dump();
|
||||
*/
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
Reference in new issue
Block a user