ScratchData LogoScratchData
Back to kriblo_test's profile

Example: Simple Scrolling Diagonal Grid

KRkriblo_test•Created April 2, 2021
Example: Simple Scrolling Diagonal Grid
7
4
58 views
View on Scratch

Instructions

In this project I have striped down the code from my previous Minecraft themed project (see below), so that the code stamping the grid, scrolling, and making the grid clickable should be easier to follow. See inside if you want to learn how it works. Arrow keys to scroll, C key to recenter. Click to randomize the color of a certain grid cell. The code randomizes a grid of colors, and stamp them on the stage. Because the colors are stored in a list, you can scroll, and the colors of each grid cell will be the same. When you click the screen, the grid cell coordinates are calculated using the mouse coordinates, together with the scroll offset. Using the grid cell coordinates, the item index in the list of colors is calculated. All code by me (@kriblo). See also, 3D Edit - "Simple" Minecraft style (3rd iteration): https://scratch.mit.edu/projects/509705419/

Project Details

Project ID510749614
CreatedApril 2, 2021
Last ModifiedApril 3, 2021
SharedApril 2, 2021
Visibilityvisible
CommentsAllowed