Page 1 of 2
z depth bug
Posted:
Sat Oct 13, 2007 2:26 pm
by j2graves
I'm trting to make a background that will follow the view, but if I make it a child actor of the main actor or the view actor, It gets the same z depth as the parent actor. so it ends up in front of everything. I tried to put the action "change z depth" on "draw actor" event, but even so, it stays in front of everything!
can someone please help me out here?
Re: z depth bug
Posted:
Sat Oct 13, 2007 2:32 pm
by Kalladdolf
let me explain your bug first:
the child actor is ALWAYS in front of the parent actor, no matter what u do.
The best way to make the backround pic follow the player is to change the view's z depth to behind everything and make the view follow the player some other way .
there are many turtorials about that.
for example for the view goes:
draw actor->script editor->
- Code: Select all
x=player.x;
y=player.y;
Re: z depth bug
Posted:
Sat Oct 13, 2007 2:41 pm
by j2graves
Thanks. I'll try it out.
Re: z depth bug
Posted:
Sat Oct 13, 2007 4:26 pm
by j2graves
Thank you! but I still have one more problem. how do you stop the background from shaking?
Re: z depth bug
Posted:
Sat Oct 13, 2007 4:43 pm
by j2graves
I have another problem now, when my main actor lands on a moving platform, the background disappears. could this have anything to do with the "change parent" action I put on the "collision on top side of moving_platform" event?
Re: z depth bug
Posted:
Sat Oct 13, 2007 4:53 pm
by Kalladdolf
if the backround image changes the parent to <none>, it automatically goes back to the position where it was createt.
why would you change it's parent, anyway?
Re: z depth bug
Posted:
Sat Oct 13, 2007 5:02 pm
by j2graves
I changed the parent of the main actor to moving_platform. I did nothing to the background. It just did that on it's own. If you have any other way of getting the main actor to follow the moving platform when he's on top of it, could you please tell me?
Re: z depth bug
Posted:
Sat Oct 13, 2007 6:51 pm
by Kalladdolf
Oh, that's what u mean!!!
could u post a ge file? (that sounds odd)
Re: z depth bug
Posted:
Sat Oct 13, 2007 10:39 pm
by DilloDude
The child actror's x and y coordinates are relative to the parent actor. To fix this problem, use xscreen and yscreen (which are always relative to the view).
Re: z depth bug
Posted:
Mon Oct 15, 2007 11:34 am
by j2graves
What exactly do you mean by, "ge file"?
Re: z depth bug
Posted:
Wed Oct 17, 2007 10:49 am
by j2graves
do you mean a game editor file attachment?
Re: z depth bug
Posted:
Wed Oct 17, 2007 7:36 pm
by tufif
Why not try just having it follow the view with a script?
- Code: Select all
x = view.x;
y = view.y;
Re: z depth bug
Posted:
Fri Oct 19, 2007 11:09 am
by j2graves
You mean have it follow the view instead of the player? I tried that already, and the background was at the top left corner of the screen.
Re: z depth bug
Posted:
Fri Oct 19, 2007 11:19 pm
by DilloDude
Wellk, then it would be
- Code: Select all
x = view.x + 512;
y = view.y + 384;
That would be for 1024 by 768 resolution. Change the numbers to half the view's size.
Re: z depth bug
Posted:
Sun Oct 21, 2007 9:49 am
by j2graves
Thank you!how do I give you a point?