Skip to content

Commit

Permalink
see #326 resolved issue with board build animation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjpro committed Sep 17, 2013
1 parent 03f946f commit 8ba2c46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions js/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -3354,10 +3354,11 @@ function Tile(board, blob, coordinates, spriteNumber) {
this.spriteNumber = spriteNumber;
}

Tile.prototype.drawComplete = function() {
var galGoldAssetPath, imageGold, layer, tile;
Tile.prototype.drawComplete = function(y) {
var galGoldAssetPath, imageGold, layer, tile, creatureY;
tile = this;
layer = this.board.creatureLayer;
creatureY = y ? y : tile.getYCoord();
if( this.board.getGoldTile(tile) ) {
galGoldAssetPath = Galapago.GAME_SCREEN_GAL_PREFIX + 'gold/' + 'gold-1.png';
imageGold = LoadingScreen.gal.get(galGoldAssetPath);
Expand All @@ -3371,7 +3372,7 @@ Tile.prototype.drawComplete = function() {
else{
layer.drawImage(this.board.level.gameImages.tile_regular, tile.getXCoord(), tile.getYCoord(), Board.TILE_WIDTH, Board.TILE_HEIGHT );
}
layer.drawImage(tile.blob.image, tile.getXCoord(), tile.getYCoord(), this.width, this.height);
layer.drawImage(tile.blob.image, tile.getXCoord(), creatureY, Board.TILE_WIDTH, Board.TILE_HEIGHT);
tile.drawBorder(Tile.BORDER_COLOR, Tile.BORDER_WIDTH);
};

Expand Down
2 changes: 1 addition & 1 deletion js/levelAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ BoardBuildAnimation.prototype.animate = function(){
break;
}
this.layer.clearRect( tile.getXCoord(), y + this.height , this.width, this.height );
tile.drawComplete();
tile.drawComplete(y);
}
}
if(complete){
Expand Down

0 comments on commit 8ba2c46

Please sign in to comment.