mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Collision Map is returned and default values added.
This commit is contained in:
parent
3b268569f1
commit
358a4c8df5
2 changed files with 4 additions and 2 deletions
|
@ -9,9 +9,11 @@ var CollisionMap = new Class({
|
|||
|
||||
function CollisionMap (tilesize, data)
|
||||
{
|
||||
if (tilesize === undefined) { tilesize = 32; }
|
||||
|
||||
this.tilesize = tilesize;
|
||||
|
||||
this.data = data;
|
||||
this.data = (Array.isArray(data)) ? data : [];
|
||||
|
||||
this.width = (Array.isArray(data)) ? data[0].length : 0;
|
||||
this.height = (Array.isArray(data)) ? data.length : 0;
|
||||
|
|
|
@ -96,7 +96,7 @@ var World = new Class({
|
|||
{
|
||||
this.collisionMap = new CollisionMap(tilesize, data);
|
||||
|
||||
return this;
|
||||
return this.collisionMap;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue