ScratchData LogoScratchData
Back to Psiborg's profile

Scrolling demo with velocity

PSPsiborg•Created June 8, 2023
Scrolling demo with velocity
31
25
494 views
View on Scratch

Instructions

Scrolling demo with velocity for @Manybook123 This is about as simple as I can make the scrolling engine. Use the cursor keys to scroll the map around. Note there is no out of bounds checking so if you scroll off into the sea, weird stuff will happen! You will need to script something to prevent that. The precreated map is a 33x38 grid (MAP_DIM_X, MAP_DIM_Y) stored by costume number in the current_segment list from bottom left to top right (33x38=1254 which is the length of the list). The costumes have a 20 pixel transparent border around them to allow them to scroll of the screen. Scratch now trims off transparent borders when you upload the sprite, however this can be got around by adding a single pixel in the corners with 1% opacity say. The map is made of a 9x7 grid of tiles which all move together. When a tile scolls off the screen, it moves to the opposite side of the screen and changes costume as appropriate.

Description

Stripped the scrolling engine out of my Mylands (https://scratch.mit.edu/projects/212264956/) project. Tiles from http://design1online.com/downloads/sprite%20tiles/RPG_Tiles_05.png

Project Details

Project ID862941807
CreatedJune 8, 2023
Last ModifiedJune 8, 2023
SharedJune 8, 2023
Visibilityvisible
CommentsAllowed