OFFICIAL Tech Blog: Going Beyond 2D With Simple Tricks (And Using 2D Tricks In 3D)

rmanthorp

YoYo Games Staff
Admin
YYG Staff
Vladimir Fedyushkin and Nicolai Danielsen are working on Jet Lancer! Nicolai has written the following blog on how they use 2D and 3D tricks within GameMaker to achieve the amazing look and feel of the game.

Jet Lancer is an action-packed game where you control a fighter jet that is as fragile as your enemies. This makes mobility the most important key to your survival. It would be near impossible to keep such a high intensity in a 3D game and still make it feasible to pull off all these stunning manoeuvres, so we went with good old fashioned 2D. The great thing about 2D is that you have a complete overview of what’s going on and never have to worry about enemies sneaking up from behind. That said, we really wanted to make it feel like there is an expansive and living world behind the screen, so we used some tricks to fake just that.

Before we get into the meat of this blog post, here is the teaser trailer for reference:


2D TO 3D
The main gameplay of Jet Lancer takes place solely on a flat plane (sorry for the pun)… but that doesn’t mean the backgrounds have to be flat! We use a very simple method to create that sense of depth. The backgrounds are standard sprites that we stretch with a handy free script called draw_sprite_pos_fixedthat you can find on the Marketplace here. The reason for not using the built-in function draw_sprite_pos is that it will create diagonal seams in the drawn texture, but luckily the Marketplace asset allows us to simulate perspective without that problem.

With the script ready, all we need is to calculate the positions for the 4 corners of the background. This is actually simpler than it might seem at first glance and can be done by offsetting the coordinates relative to a focus point, which will usually be tied to the camera.

READ MORE: https://www.yoyogames.com/blog/511/going-beyond-2d-with-simple-tricks-and-using-2d-tri
 

Miradur

Member
Thanks for sharing, Ross. I hope you also reported the misrepresentation on draw_sprite_pos() as a bug? ;)
Of course I grant the author of the patch his money, but it's clearly a GMS2 bug, right?

Miradur
 
Top