Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Scratch 2.0 Game Development Hotshot
  • Table Of Contents Toc
Scratch 2.0 Game Development Hotshot

Scratch 2.0 Game Development Hotshot

4.4 (14)
close
close
Scratch 2.0 Game Development Hotshot

Scratch 2.0 Game Development Hotshot

4.4 (14)

Overview of this book

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

Adding enemy patterns


We will create two more enemy types that follow different attack patterns. The starfish in our first sprite are moving in a straight line one after the other. For the second enemy sprite, we will create a script that causes that enemy to spread out, making it a bit harder to avoid. For the third enemy, we will write a script that makes this enemy type a bit unpredictable, moving in a wavy pattern and turning unexpectedly.

Prepare for lift off

Before we begin scripting, we need two more enemy sprites, which we will create using the following steps:

  1. Right-click on the Starfish sprite and choose duplicate. Do this twice to create two more enemy sprites, including the enemy sprite scripts.

  2. To differentiate between the three enemy types, we will recolor the second and third sprites.

  3. For the second sprite, we select a blue color and fill the body of the sprite with it.

  4. For the third sprite, we select a yellow color and do the same.

The sprites are automatically renamed as Starfish2...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Scratch 2.0 Game Development Hotshot
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon