HTML and CSS Reference
In-Depth Information
var tiles =[];
for(var y=0;y<this.level.length;y++) {
tiles[y] = [];
for(var x =0;x<this.level[0].length;x++) {
var square = this.level[y][x],
frame = null,
method = this.legend[square] || "wall";
frame = this[method](x*tileSize,y*tileSize);
tiles[y].push(frame);
}
}
this.setup(tiles,true);
},
insert: function(sprite) {
this.stage.insert(sprite);
this.sprites[sprite.p.tileY][sprite.p.tileX] = sprite;
return sprite;
},
unfog: function(x,y) {
for(var sx=x-2,ex=x+2;sx<=ex;sx++) {
for(var sy=y-2,ey=y+2;sy<=ey;sy++) {
this.show(sx,sy);
if(this.validTile(sx,sy) && this.sprites[sy][sx]) {
this.sprites[sy][sx].show();
}
}
}
},
wall: function(x,y) { return TILE.WALL; },
floor: function(x,y) { return TILE.FLOOR; },
stairs: function(x,y) {
this.startX = x;
this.startY = y;
return TILE.STAIRS;
},
gold: function(x,y) {
this.insert(new Q.Loot({ x:x, y:y }));
return TILE.FLOOR;
},
fountain: function(x,y) {
 
Search WWH ::




Custom Search