ScratchData LogoScratchData
Back to kriblo_test's profile

Example: Sprite sort on Z & 3Desque perspective

KRkriblo_test•Created April 13, 2021
Example: Sprite sort on Z & 3Desque perspective
30
22
153 views
View on Scratch

Instructions

Example: Sprite sort on Z and 3Desque perspective using a View Factor. Move the mouse around to test this example. Notice how the Cat moves in front and to the back of the grass, as the Cat seemingly moves closer and further away. All code by me (@kriblo). Study the code inside. Walking Scratch Cat costumes made by @Griffpatch. The grass, I modified from an image found on the world wide web. Backdrop by me. How it works: - Clones of grass are created and assigned a Z value, which is stored in a sorted global list. - The cat moves to the mouse pointer and a Z value is calculated based on screen Y position. - Size of clones of grass and the Cat are calculated based on Z, using a view factor (VF). The speed of grass clone movement is calculated using the same formula. - Each Tick, the cat moves to the front, and then moves back one layer for every clone of grass with a lower Z value. As always, I have only one "When Green Flag Pressed". In the code under this hat block I initiate and Start the project using "broadcast and wait" and "broadcast", respectively. In this example, that is handled in the stage code.

Project Details

Project ID514940954
CreatedApril 13, 2021
Last ModifiedSeptember 17, 2021
SharedApril 13, 2021
Visibilityvisible
CommentsAllowed