Switch to full stage
Loading Project
Loading project …

Instructions

Controls: WASD..............Move player Arrow keys.......Rotate camera Space..............Jump Shift................Crouch M....................Toggle mouse controls O....................Show options P.....................Pause F.....................Toggle FPS Counter

Notes and Credits

The theory behind the way this works is using the fake surface method I described in the comments on the project I remixed Inside the 'load quad' block, instead of calling the 'int load tri' block to load surfaces, we use a block I created for this project, called "load quad into tri". The "load quad into tri" block is nearly identical to the "int load tri" block, except that, even when the surface is fully visible, a fake tri surface will always be created for it. This means that the inputs for P1, P2 and P3 are respected as they are what get put in the fake surface. (Otherwise, the P1, P2 and P3 coordinates would have no effect on what was rendered) You might also notice that the 'Draw quad' block now does nothing. This is because we convert the quads into 2 fake triangles, meaning that the "draw surfaces" block will never find any quads. Note that, at this point, it is far simpler to instead to change the "add quad surface" block in the objects sprite to simply call "add tri surface" twice. (Because ultimately that's what we end up doing - just treating a quad as 2 tris) However, the ultimate benefit of this method though is that the developer can still access a quad as a single surface (and therefore only have to set the texture once, etc.) (Btw, another issue in the original code which probably didn't help was that, on the second 'int load tri' block in the 'load quad surface' block, you used P2 for the second input, but it should have been P1)

TurboWarp is a Scratch mod that compiles projects to JavaScript to make them run really fast. Try it out by inputting a project ID or URL above or choosing a featured project below.