search
user.png
vertical menu

Scratch: Sprite Scrolling (Game Mechanics #1)

Scratch: Sprite Scrolling (Game Mechanics #1) preview
Scratch: Sprite Scrolling (Game Mechanics #1) preview
Scratch: Sprite Scrolling (Game Mechanics #1) preview 2
Scratch: Sprite Scrolling (Game Mechanics #1) preview 3
Scratch: Sprite Scrolling (Game Mechanics #1) preview 4

Look Inside · 10 pages

Cover of the Scratch guide Sprite Scrolling, Game Mechanics #1, showing the Scratch cat walking under clouds
Title page for the Roombop game mechanics guide
What's included: overview of sprite scrolling and the eight sections, from Learning Goals and Variables to Hiding Sprites
Teacher overview and contents of the guide
Learning goals: scrolling with a camera variable, giving each sprite its own position and main game loop using broadcasts
Share goals with students before they start coding
Variables: students make cameraX and cameraY with Make a Variable, then myX and myY for this sprite only
Step 1: setting up the variables scrolling needs
Controlling sprite: students add a when flag clicked script that broadcasts reset, then position in a forever loop
Step 2: building the main game loop
Initial values: a when I receive reset script sets myY and myX to 0 so each scrolling sprite gets its starting position
Step 3: starting positions for scrolling sprites
Position sprites in three parts: students build go to x: myX - cameraX, y: myY - cameraY under when I receive position
Step 4: the core scrolling script, built in parts
Moving the cameras: the main loop changes cameraX by mouse x / 100 and cameraY by mouse y / 100 to scroll with the mouse
Step 5: testing the scrolling with mouse control
Moving the sprites: change myX and myY, and set cameraX and cameraY to the position of sprite Main in the main loop
Step 6: making the camera follow a player sprite
Borders and hiding: fix sprites stuck at the screen edge with a front-layer border or if-else code that shows or hides
Step 7: cleaning up sprites at the stage edge
Attributes
File

PDF

Editable
No
Author
Roombop
Rating
Add To Collection
Add to collection Add to collection

About This Product

This guide will show you how to do scrolling for sprites. Scrolling can be a little complicated, but if you read carefully, and understand what is written, then it should be very simple. The same technique is used to make higher level games like 3D and pen platformers. So I thought that scrolling was a good place to start. 

This package is a great resource to have your students follow. These game mechanic guides are great to teach specific techniques and skills that can be used to create a game. They allow the students to expand their knowledge of Scratch. It is recommended that your students have an understanding of Scratch before using this resource.

What's Included

This guide will show you how to do scrolling for sprites.

0 Reviews

Explore related searches