• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Sprite having multiple depth?

B

Borschik

Guest
Let's say my game have a desk with a chair, and a character. I want character to come to the desk, sit on the chair and rest his hands on top of the desk.

The problem is that his legs should become covered by the desk, while his hands should be covering parts of the table.
I can make one sprite to be completely in front or behind another one, not part of it behaving a different way.

How can I do this properly? Somehow delete character sprite and draw him to the actual desk sprite without legs, and then later make character appear in the correct place when he gets up?

Here is an example picture
 

TsukaYuriko

☄️
Forum Staff
Moderator
Draw two parts of the sprite - one below, one above the table - for example, using a controller object which draws all three involved sprites, in the correct order. Alternatively, if you're using GM:S 2, you could also use sprites in combination with layers instead of a controller object.
 
Top