Scratch 2.0 Game Development HOTSHOT

Sergio van Pul

Language: English

Pages: 330

ISBN: 1849697566

Format: PDF / Kindle (mobi) / ePub

10 engaging projects that will teach you how to build exciting games with the easytouse Scratch 2.0 environment

About This Book

  • Discover how to make the most of the new Scratch 2.0 interface
  • Understand how video games work under the hood
  • Make your projects come to life, using practical programming principles
  • Learn how to plan and build your own interactive projects

Who This Book Is For

If you are a new, or current Scratch user and would like to improve your understanding of the new Scratch 2.0 interface, and learn how to make video games, this book is ideal for you. Each project is explained in-depth from start to finish, so everyone can follow along, even if you don't have much previous experience with the software. If you want to become a video game designer, this book is an easy- to- use and friendly guide about the world of interactive media. It will teach, challenge, and inspire you to create great interactive projects.

What You Will Learn

  • Draw and edit game graphics
  • Construct scripts from logic blocks
  • Utilize operators and conditions to steer game actions
  • Use variables and lists to save and reuse dynamic numbers
  • Create both mouse and keyboard controls for various purposes
  • Implement natural physics effects such as collisions and gravity
  • Invent and build power-ups
  • Learn how to use some advanced math, for better looking movement patterns
  • Make interesting level designs
  • Balance the game for an enjoyable experience
  • Reuse elements to speed up the building process

In Detail

Playing video games is fun, however, it's even more fun to make your own! Scratch 2.0 makes that challenge a lot easier. Instead of diving into abstract and confusing code, you can build games using easy to understand logic blocks. Within minutes you can have your first game up and running.

Readers can look forward to an easily accessible and fun introduction to programming and interactive media design. Within minutes of starting the program, you will be able to see the first results of your hard work. Visual feedback comes early and often, making high-level, abstract concepts a lot easier to understand.

This book offers readers access to completely interactive projects based on well-known video game genres. You will then learn how to use standard programming principles such as operators, variables, and functions.

From a broader perspective, you will also learn how to plan and develop a game from a general idea to the finished product, creating a fun and user-friendly game. Scratch 2.0 includes many new and exciting features, which makes it possible to create more advanced games. The final results will be close to production level games. This book will not only introduce you to the Scratch 2.0 software, but also teach you about interactive media design.

















4. Double-check to make sure that your collection of separated sprites describe a full circle in approximately equal steps. With the images ready to be loaded, we can start adding them to Scratch by using the following steps: 1. In Scratch, create a new sprite and name it kart1. 2. Click on the New costume link to open the drop-down menu. 3. Select the Import option. 4. Select and import the first sprite costume. 5. Click on the Set Costume Center icon and place the center point at the bottom of the image between the wheels; see the following screenshot: 77 Start Your Engines 6.

The following are the steps to do it: 1. Go to the Scripts tab to start making use of the new costumes. We will make changes to the clone script. 2. Drag the collision check condition out of the script and put it aside for later use. 3. Remove the forever loop from the script. 4. In its place, put a repeat until … block. 5. Set the collision check inside this block. 6. Get a = operator block and place it in the condition slot of the repeat until … block. 7. Place the costume# variable from the Looks category in one slot of the equation.

But we need to be careful about not obscuring too much of the important stuff like the diver and the starfish. After creating the foreground images, we can drag-copy the script from the background to the new sprite. We make a few additions to this script that we take from the parallax scrolling script: 1. The images should be in the front layer. 2. The speedMultiplier value should be quite high, somewhere between 2. 5 and 4 works well; enter 4. 3. Check whether the starting x positions for both foreground images are correct; enter -240 and 240 respectively.

You can try it yourself with a ball or a stone. Throw it upwards in front of you and see what happens. Just be careful with the neighbor's windows! Creating a parabolic shot The ball will move upwards in the direction you threw it. At some point it will start to slow down, stop, and then start falling down. The path the ball follows is called a parabola. This is what we expect of gravity. It's always around us, so we don't pay too much attention to it. If you would throw the ball in space, which has no gravity, the ball would move on forever in a straight line, as it does now in our game.

1. First, make a copy of the kart1 sprite to easily get a second kart sprite with all of the scripts attached. 2. Instead of following the player1 sprite, this sprite has to follow player2 (using go to ). 3. We also need to change the key pressed controls from a/d to left/right. 4. The hard work comes with changing the costumes. We need to follow the same procedure we used earlier to create a series of Luigi sprites. Replace all of the Mario costumes with the equivalent Luigi costumes. 5. Once we're done with the images, we can check the animation with the small test script that loops through all of the costumes.

Download sample


Rated 4.65 of 5 – based on 40 votes