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

Creating attack pattern 1


To make this fight more interesting, let's start writing the attack patterns.

Prepare for lift off

The thing with attack patterns is figuring out an interesting movement pattern first and then finding a way to create a script that moves the sprite according to that pattern. For this game, we will create three very distinct movement patterns.

The first one will be to move the boss in a pattern similar to the number 8. The number 8 will be lying horizontally, so the boss sprite will appear to be bobbing back and forth and weaving around the player character.

Engage thrusters

We will start this pattern when the correct message is called. Since this is the first pattern that we make, we have named it pattern1.

  1. We add a new script starting with when I receive <pattern1>.

  2. Then we use set rotation style <all around> so that the sprite can move about freely and make loops as it goes.

  3. We move the sprite to the center of the screen with glide 1 secs to x: () y: (); fill...