ScratchData LogoScratchData
Back to stlee987's profile

Scrolling World Map

STstlee987•Created September 14, 2015
Scrolling World Map
100
93
6628 views
View on Scratch

Instructions

This is a scrolling world map. Controls: left arrow, right arrow: Scroll the map left or right. It will wrap around. up arrow, down arrow: Scroll the map up or down. space bar: Reset the map back to its original position.

Description

This demonstrates how to do scrolling and panning in Scratch. Some of the challenges are: 1. Sprites cannot be bigger than 480x360 so the map image is split into tiles of this size. 2. Scratch has a 15-pixel border that prevents a sprite from going outside of the staging area. To overcome this, the sprites overlap by 15 pixels and are shown and hidden accordingly. 3. Location (0,0) is at the center of the stage, and sprites are centered at this point. Because of this, it takes a bit more calculation to put a sprite at the edge of the stage (e.g. left side of stage). 4. The lack of >= and <= operators make some of the numbers less intuitive to understand because I had to subtract or add 1 to the value.

Project Details

Project ID76646196
CreatedSeptember 14, 2015
Last ModifiedAugust 21, 2020
SharedSeptember 14, 2015
Visibilityvisible
CommentsAllowed