Nudging the Block Breaker table

I’d like to share my solution to the boring ball loop. I’m actually letting the player decide when the ball is “boring” and slightly tweak its velocity vector with a mouse click. This is conceptually similar to nudging a pinball table.

In the Ball script:

    void Update() {
        if (!hasStarted) {
            LockToPaddle();
            LaunchOnMouseClick(launchVelocityX, launchVelocityY);
        } else { // game already started; click to tweak the ball's motion vector
            LaunchOnMouseClick(_rigidbody.velocity.x + 2f, _rigidbody.velocity.y + 4f);
        }
    }

If the game has not started, I just launch the ball on mouse-click as Rick did earlier in this course. If the ball has already launched, and the player clicks the mouse, I tweak the ball’s velocity at a slight angle. What I like about this is that the player can use well timed clicks to greatly speed up, or slow down, the velocity of the ball. It adds an extra technique for the player to master, or ignore, at their discretion.

Privacy & Terms