ScratchData LogoScratchData
Back to gtoal's profile

Draw textured trapezium (optimisations requested)

GTgtoal•Created October 29, 2014
Draw textured trapezium (optimisations requested)
21
14
565 views
View on Scratch

Instructions

This works a LOT better under Phosphorus: http://phosphorus.github.io/app.html?id=31815198&turbo=false&full-screen=false I had an idea that games like Wolfenstein could be implemented with fully-textured corridors by slicing hi-res images into vertical strips and then plotting those stripes scaled in a trapezium - it was meant to be fast and simple. Well, due to a combination of a scratch plotting bug, a scratch plotting 'design feature', and the cost of changing costumes, it turns out that it is neither fast nor particularly simple. Nevertheless, here is the code if anyone wants a chuckle, and if by any chance you're able to improve it (or if Scratch speeds up a lot at some point in the future) then a combination of this plus the "Painter's Algorithm" (as in http://scratch.mit.edu/projects/31569616/ ) ought to make for some flashy and relatively simply coded 3d games. The main use I had planned for this was to create a virtual walk-through art gallery, hence why I wanted high-res imagery on the walls.

Description

Tip of the hat to @MegaApuTurkUltra for passing on the workaround that avoids the sprite scaling bug and big thanks to @SuperDoggy for speeding up the code by a factor of about 10! Still looking for any more optimisations that could significantly speed this up to the point that it's usable in a walk-through enviroment. So far the only way to make it usable is to compile it to an exe with procd's compiler or use Phosphorus!

Project Details

Project ID31815198
CreatedOctober 29, 2014
Last ModifiedMarch 16, 2015
SharedOctober 29, 2014
Visibilityvisible
CommentsAllowed