"use strict";
/* a one-shot grid of poof spots, e.g. to accentuate a chunk of room which has changed duirng a swap */
var Deco_Poofblock = function(tilesw,tilesh){
	this.tilesw = tilesw ? tilesw : 4;
	this.tilesh = tilesh ? tilesh : 4;
	this.frame = 0;
}

Deco_Poofblock.prototype = new Decoration(
	new TileSheet(
		4, 4, 2, 0, 
		SDS_Load_Image("art/sheets/sprite/poof.png")
	),
	"Poofblock");

Deco_Poofblock.prototype.animate = function(){
		if (this.frame<4){
			++this.frame;
		}
	}

Deco_Poofblock.prototype.drawIntoCanvas = function(canvas){
		if (this.frame<4 && this.tile_sheet){
			for (this._heap.j=0; this._heap.j<this.tilesh; this._heap.j++){
				for (this._heap.i=0; this._heap.i<this.tilesw; this._heap.i++){
					this.tile_sheet.drawIntoCanvas(
						canvas,
						this.frame,
						this.x + this._heap.i*this.tile_sheet.tile_pixel_width,
						this.y + this._heap.j*this.tile_sheet.tile_pixel_height);
				}
			}
		}
	};
