Skip to content

Commit

Permalink
Added a Block Placed event.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoGonzalez committed Jul 6, 2015
1 parent e211040 commit 3e859e6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/blockrain.jquery.src.js
Expand Up @@ -28,6 +28,8 @@
onRestart: function(){},
onGameOver: function(score){},

// When a block is placed
onPlaced: function(){},
// When a line is made. Returns the number of lines, score assigned and total score
onLine: function(lines, scoreIncrement, score){}
},
Expand Down Expand Up @@ -802,6 +804,13 @@
game._filled.checkForClears();
this.cur = this.nextShape();
this.renderChanged = true;

// Stop holding drop (and any other buttons). Just in case the controls get sticky.
this.holding.left = null;
this.holding.right = null;
this.holding.drop = null;

game.options.onPlaced.call(game.element);
}
}
}
Expand Down

0 comments on commit 3e859e6

Please sign in to comment.