ScratchData LogoScratchData
Back to kriblo_test's profile

Example: Simple method to scroll ground in top-down games

KRkriblo_test•Created September 20, 2022
Example: Simple method to scroll ground in top-down games
23
13
152 views
View on Scratch

Instructions

In certain types of top-down games, you want the playable character to always be in the center of the screen, not moving (other than turning in the direction the player is guiding it). Instead, the map/ground/level moves. However, if you have a pre-drawn level, there are bounds to the level, where the player should either stop, turn, or bounce. In this example I demonstrate a simple way to achieve this, using a bouncing Controls sprite (purple dot in this example, see inside). The players position on the map, is set using the Controls sprite position, and the zoom factor for the map (again, see inside). All code by me (@kriblo). It might not be pretty, but I felt it was an approach which might be useful for many Scratchers. I came up with it for this Pico episode: https://scratch.mit.edu/projects/734303771/

Project Details

Project ID734350341
CreatedSeptember 20, 2022
Last ModifiedSeptember 20, 2022
SharedSeptember 20, 2022
Visibilityvisible
CommentsAllowed