image

4SHOOTING HOOPS WITH GRAVITY

Many platformer games, such as Super Mario Bros. and Donkey Kong Country, show a side view of the action, where the bottom of the screen is the ground and the character is shown from the side. These games have gravity: characters can jump up and then fall until they land on the ground. In this chapter, we’ll write a basketball game that has gravity. The player will jump and throw a basketball, and the basketball player and ball will fall downward.

Before you start coding, look at the final program at https://www.nostarch.com/scratchplayground/.

SKETCH OUT THE DESIGN

First, let’s sketch out what we want the game to ...

Get Scratch Programming Playground now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.