Page 1 of 1

help with beat em up style game

PostPosted: Mon 8 Oct 2018, 09:54
by neonfrost
Hello i am trying to create a beat em up style game but i have this big problem with making objects change from being in front of the character wen the character moves behind of it and being behind the charcter wen the character moves in front of it .....here is an example of what i want to do

Image

Image

Image

Image

unfortunatly i dont know exactly the best way to do this ....because the object also has to collide and stop the character wen he comes in contact with it. I would also like to note that i have zero experience making games, this is the first one im making so i dont understad a lot of what i am doing.

Re: help with beat em up style game

PostPosted: Mon 8 Oct 2018, 17:05
by Lizard-13
There is an example doing exactly that, create a new GD5 project and in the examples window search for "Z depth" :)

But the idea is to set the Z-order of every object = the bottom Y position of the object. An object that has the base Y position greater than other will get a greater Z-order and will be rendered over it.

Re: help with beat em up style game

PostPosted: Tue 9 Oct 2018, 01:00
by neonfrost
hey wow! thanks a lot! i did exactly what you said and it worked .....only problem now is this.

Image

Image

Image

i can see his legs under the crate, what did i do wrong. Is it because i didn't add the "at the begining of the scene" thingy

:(

Re: help with beat em up style game

PostPosted: Tue 9 Oct 2018, 01:47
by MeX1Co
It could be that the origin point of your sprites are in the top left... So in the first picture your character's y position is actually lower than the obstacle... If you put them at the bottom middle it should work...

Re: help with beat em up style game

PostPosted: Tue 9 Oct 2018, 01:58
by neonfrost
alright thanks! ill try that right now! :)