Book Image

Scratch 2.0 Game Development Hotshot

Book Image

Scratch 2.0 Game Development Hotshot

Overview of this book

Table of Contents (18 chapters)
Scratch 2.0 Game Development HOTSHOT
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 harmed when touched by either one of the enemies. That's rather unfair, so let's change that as well.

  1. We check the scripts for the cat sprite.

  2. There we also find a collision check for explosion.

  3. We add to this an if touching <Knight...