ZDepth. How can I add/substract it in game mode?

Talk about making games.

ZDepth. How can I add/substract it in game mode?

Postby xenidius93 » Thu Sep 11, 2014 2:04 pm

There's
ChangeZDepth("Event Actor", 0.500000);

but I want to add/substract some, in game. How can I write it (in Draw Actor)?
I want to make "3D" effect.

If actor's Y position is 0 ZDepth = 0.5
If actor's Y position is 1 ZDepth = 0.500001
If actor's Y position is 2 ZDepth = 0.500002 etc.
xenidius93
 
Posts: 37
Joined: Mon Jul 28, 2014 4:24 am
Score: 1 Give a positive score

Re: ZDepth. How can I add/substract it in game mode?

Postby skydereign » Fri Sep 12, 2014 1:33 am

For now you need to create a zdepth variable to use. That way you can manipulate the variable and use ChangeZDepth("Event Actor", zdepth).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: ZDepth. How can I add/substract it in game mode?

Postby Zivouhr » Fri Sep 12, 2014 9:46 pm

I noticed the word 3D was used. ZDepth is more like layers in a photo editor like Photoshop or Gimp, where it remains the same size, just can be placed behind other layers depending on where the ZDepth slider is at. Unless there is something I missed, I wonder how it could be used to scale an object to look larger than it was at first. ? Not sure.

There's a demo showing Mode 7 more or less on this forum. Also check out LCL's Sabre demo, which is pretty amazing considering this is a 2D program without any built in sprite scaling feature from what I found so far. It's like the classic Wolfenstein 3D.
City of Rott Game created on Game Editor http://cityofrott.wordpress.com/
User avatar
Zivouhr
 
Posts: 549
Joined: Sat May 17, 2014 2:12 pm
Score: 59 Give a positive score

Re: ZDepth. How can I add/substract it in game mode?

Postby skydereign » Fri Sep 12, 2014 10:12 pm

Zivouhr wrote:I noticed the word 3D was used. ZDepth is more like layers in a photo editor like Photoshop or Gimp, where it remains the same size, just can be placed behind other layers depending on where the ZDepth slider is at. Unless there is something I missed, I wonder how it could be used to scale an object to look larger than it was at first. ? Not sure.

ZDepth can be used to fake 3d, especially if you are going for an orthographic view. A lot of 2.5d games simulate a 3d world by setting the zdepth layer based off of the y positional value. The further up they are on screen, the further back they should be.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: ZDepth. How can I add/substract it in game mode?

Postby xenidius93 » Thu Sep 18, 2014 8:37 am

Thanks, ChangeZDepth("Event Actor", zdepth) it's working :D.
xenidius93
 
Posts: 37
Joined: Mon Jul 28, 2014 4:24 am
Score: 1 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest