ScratchData LogoScratchData
Back to gtoal's profile

automatic depth ordering for x/y scrollers, rpgs etc

GTgtoal•Created October 16, 2016
automatic depth ordering for x/y scrollers, rpgs etc
14
9
103 views
View on Scratch

Instructions

I'm trying to come up with a cheap and easy way of ordering sprites so that players can walk in front of and behind objects without needing to do complex depth calculations. This isn't bad but relies on positioning object sprites sufficiently far apart that the player can't touch two at once. That's something the game designer can control so doesn't rule out using this method in a game. A better system would involve sorting all the Y positions and assigning depths to each unique Y position, then setting the depth according to the y position. It would help a lot to have invisible sprites between each Y level, with a depth that is set between the level of the one above and the one below, so the player is assigned (say) all odd depths and the objects are assigned all even depths. Ideally I want to order all the objects statically and the player dynamically. For now I'm doing both which is clearly wrong.

Description

Was thinking about this problem as a result of recent chat with @Locomule re isometric display of roguelike games. Should also work if using vanishing-point perspective (shrink the sprites proportional to z dist ie y base) Here's another trick worth using: https://scratch.mit.edu/projects/40603034/ - determine ordering by broadcasting and counting...

Project Details

Project ID125917558
CreatedOctober 16, 2016
Last ModifiedOctober 26, 2016
SharedOctober 16, 2016
Visibilityvisible
CommentsAllowed