Commit 1749dc5a authored by Terence Martin's avatar Terence Martin

Fix AI bug

During simulation of a drop, a vanished gray brick would count as a
bonus brick and add points to the ball, even though in practice this
is not a situation in which points are scored.

As a result of this the AI would prioritize moves through vanished
gray bricks over regular drops for no discernible reason.
parent 6e654caa
......@@ -2494,6 +2494,10 @@ var nurdz;
* @returns {Point} always null; we never move the ball
*/
Brick.prototype.ballTouch = function (maze, ball, location, isSimulation) {
// No matter what, we never want to do anything unless this is a bonus
// brick; when we pass through gray bricks, we just pass through them.
if (this._brickType != BrickType.BRICK_BONUS)
return null;
// We are not simulating; this is a normal touch.
if (isSimulation == false) {
// If this is a bonus brick and it is visible, then vanish
......
......@@ -265,6 +265,11 @@ module nurdz.game
*/
ballTouch (maze : Maze, ball : Ball, location : Point, isSimulation : boolean) : Point
{
// No matter what, we never want to do anything unless this is a bonus
// brick; when we pass through gray bricks, we just pass through them.
if (this._brickType != BrickType.BRICK_BONUS)
return null;
// We are not simulating; this is a normal touch.
if (isSimulation == false)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment