Step 2: Adding Difficulty to the “Power” Mechanic

Goal:


As of right now, the game doesn’t really feel that fun. It is super easy and not very engaging, the hammer just goes up every time.

Next we’re going to add a timed subtraction from our “Power” variable, this will make it so our “Power” gets lower if we don’t press space fast enough, which makes it a lot more fun and challenging.

Note how we only do this if we have a “Power” > 0. Why do we do this?

Steps:

  1. First select the “Hammer” sprite
  2. From Control place an “if then” block inside the repeat until block
  3. From Operators place a > (greater than) block inside the if then block
  4. From Variables place “Power:” on the left side of the > block
  5. Type in 0 on the right side of the > block
  6. From Variables place a change by block inside the if statement
  7. Inside that change by block, make sure “Power:” is selected, and set the number to -1
  8. From Control place a wait block and set it to 0.75 seconds

Code:


Click to replay