ScratchData LogoScratchData
Back to rdococ's profile

Fast Sandbox

RDrdococ•Created January 26, 2022
Fast Sandbox
2
2
32 views
View on Scratch

Instructions

1 - Erase 2 - Place sand 3 - Place water 4 - Place ash

Description

This is a fast sand physics simulation in Scratch. Optimizations used: - Partial rendering: Only particles that change are re-rendered on each frame. - Update queue: Only the particles that need updating are added to a queue for the next frame. - Update set: There is an update set, speeding up checking if a particle is already in the queue. - Two update queues: There are actually 2 update queues (and 2 sets). One queue is scanned while updates are added to the other, then it swaps. - Queueing fewer updates: When a sand particle falls, only the positions above its old position, as well as the new position itself, are actually queued. - Queueing even fewer updates: Extra checking is used to only queue particles that will actually want to move. - No edge checking: Impenetrable walls replace the need to check against the edges.

Project Details

Project ID634224001
CreatedJanuary 26, 2022
Last ModifiedAugust 17, 2024
SharedJanuary 26, 2022
Visibilityvisible
CommentsAllowed