Tweaking and balancing

To finish this project, we will add a few more details to prepare for the next project. In the next project, we want to add a boss fight to this game; but when should the boss appear? I've decided to make this a timed event. The player should survive for a certain amount of time, shooting enemies along the way to increase the power of the spear. After 90 seconds, the starfish will disappear and a boss monster will appear.

You may have also noticed that the scrolling images tend to stick to the sides of the stage before disappearing. This is a feature of Scratch to prevent you from completely losing sight of sprites. To get rid of these lingering sprites, we use a visual trick to obscure them.

Engage thrusters

Let's first work on the time limit to complete our game. We will use the built-in timer to count the seconds until the boss appears.

  1. Go to the Stage object to add some scripts.
  2. We first reset the timer (using the reset timer block) to start counting from 0 when the game starts.
  3. Then, we let the script wait until the timer is greater than 90 by entering 90 in the wait until timer > () block.
  4. If the condition is met, we use the stop <all> block for the moment. The level is finished. We will change this action with a script for the boss's appearance in the next project.
    Engage thrusters

To get rid of the lingering images, we will draw curtains similar to what you would see on a theater stage. This narrows the effective stage area somewhat, but that's not a problem, and the sprites can safely stay behind the curtains, out of view.

  1. We paint a new sprite. This sprite will be as big as the stage.
  2. Click on the zoom out icon to see the entire stage in the costumes editor.
  3. We make sure that we are working in the Bitmap mode.
  4. With the Rectangle tool, we draw two black vertical strips at either side of the stage area. Finding the right width to obscure the sprites can take a bit of testing and changing the size of the strips.
    Engage thrusters

We add a short script to correctly position the sprite at the start of the game using the following steps:

  1. Start with the when <green flag> clicked block.
  2. Enter 0 and 0 in the go to x: () y: () block respectively.
  3. Enable the go to front block. This makes sure that the curtains are on top of everything else.
    Engage thrusters

Objective complete – mini debriefing

With these additions, we conclude this project. There is still more work to do, but what we have created in this project already makes for an enjoyable game. Adding the timer gives us a clear endpoint for the game and emphasizes the game goal—gather as many points as possible before the timer runs out.

Objective complete – mini debriefing
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.136.63