O'Reilly logo

Scratch 2.0 Game Development HOTSHOT by Sergio van Pul, Jessica Chiang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tying up loose ends

The game is almost complete. There are just a few final adjustments to be made for all the sprites to interact properly.

Engage thrusters

Let's first solve the issue where the enemies don't respond to being hit by the sword or the arrow. What we are lacking is a collision check for these items. This can be easily fixed by the following steps:

  1. We look at the Knight scripts.
  2. In the clone script, we find a collision detection for the explosion block. We can add more checks here.
  3. We expand the existing condition with the or touching <sword>? or touching <arrow>? block.
  4. Then, we switch to the ghost sprite and add the same blocks there.

That fixes our collision problem, but not all the problems. As you may have noticed, the cat isn't actually ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required