ScratchData LogoScratchData
Back to kriblo_test's profile

Example: Grid Cell & Wall Editor

KRkriblo_test•Created November 11, 2021
Example: Grid Cell & Wall Editor
8
4
57 views
View on Scratch

Instructions

Following a discussion with @colinmacc about bitwise operations and mazes, I started thinking how I would go about managing walls in a maze. In this example I basically use a wall-grid which is 1 wider and 1 higher than the cell-grid. I then pre-calculate a list of cell-to-wall indexes for the wall-status list, to keep track of each cell's walls. This means each wall status is only stored in one place, while two cells have a reference to it. Click the cells or walls to toggle their status. Press S to change grid width and height (number of cells, odd numbers from 3 to 19). All code by me (@kriblo). Thank you @colinmacc for the inspiration.

Project Details

Project ID599714159
CreatedNovember 11, 2021
Last ModifiedFebruary 28, 2022
SharedNovember 12, 2021
Visibilityvisible
CommentsAllowed