Breakout Game – Track the score and win

In this lesson, students will learn:

  • How to award points for every brick a user hits, and keep count of the total score
  • How to give the paddle mouse control
  • How to give players lives

Logical operators are typically used with Boolean (logical) values. When they are, they return a Boolean value. However, the && and || operators actually return the value of one of the specified operands, so if these operators are used with non-Boolean values, they may return a non-Boolean value.

Track the Score and Win
Mouse Controls
Finishing Up
Logical Operators