Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Simple 3D effect for GameMaker: Studio 1.4 & 2 (Tutorial)

A topic by Sa_Ko created Aug 04, 2018 Views: 1,203 Replies: 4
Viewing posts 1 to 2
(1 edit) (+2)

If you want to create a simple 3D effect for your game, you should test sprite-layering as a simple and easy method. I am writing this for those who maybe didn't know about it. Tip: Its useful ^^

So, as I already wrote, the method is based on laying sprites above each other to create an 3D effect.

Step one: Create the sprites: To make the method work correctly, you should create the right sprites with sub-images.

For example, you want to create, let's say, a tank. So, start off by thinking  about how the different "slices" of a tank would look like if you slice it horizontally. What I mean by that is: 1st subimage: The tracks, 2nd subimage: The tracks with those "wheels", 3rd: Tracks and the lower hull plate, and so on. You will find a demo of what I exactly mean here;


So now, we need to draw them in the correct order.

So we do in a draw event:

for(i = 0, i < image_number, i++){draw_sprite(sprite_index,i,x,y-i,image_xscale,image_yscale,direction,image_blend,image_alpha)}

Thats it. Try it yourself!

Sounds interesting but I don't understand how this creates a 3D effect. I have done something similar using objects with different depth in Gamemaker. Multiple sprites over each other are still 2D-looking to me.

(1 edit)

It creates a 3D-ish view to the player. Just try it yourself

Just played it and it really does give a 3D effect. I can really use this for my project and will try to understand it when I have some time. Thank you for this!

(+1)

No problem! I hope you can make something with this little trick! But one thing: It gets really slow and will cause your game to lag if you have too many objects in your room. So you should only render the objects which the player can actually see. For example, test if the object is inside your view, if it is, render, if not, then not. Thanks so much for your attention :)