Background Depth Question:

Game Editor comments and discussion.

Background Depth Question:

Postby d-soldier » Wed Apr 11, 2007 8:01 pm

Heres what I want to do.. made a diagram to help you all understand, so as to clear up and misunderstanding from the words I use.
Image
Figure A represents the VIEW and my unmoving background layer. No problems here with my code.
Figure C is my foregournd which follows my player actor (though he is not cenetered in this image, ignore that) No problems here either.
Figure B is the probelm. My midground image I want to move as the actor moves, but at 50% speed, giving some depth to an unmoving background, and rapidly moving foregound. This technique is common in these kinds of games, and I'm sure the answer is an easy one, but as previously noted, I'm a graphics guy and not good with the programming (depite making text games in QBASIC when I was ten) aspects.
Attachments
ds_game1.gif
attached image as well...
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Fuzzy » Wed Apr 11, 2007 10:40 pm

make the midground infinately tiled along the x axis. give that actor a x velocity. whenever the player steps. Same with the other layers.

The programming term you want is parallax layers.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby d-soldier » Thu Apr 12, 2007 3:06 am

It's not an issue of how to logically make it happen, I've already thought of several ways to do it, but as I stated, it's a lack of knowing what to code/script and where to do it. I've researched "infinite" tiling (as you stated) but cant find it within the documentation, nor playing around with the actor controls. And I cant seem to get the MidGround actor to place where I want it without giving it the x/y location of the View/Player actor, which seems to negate the effect of it moving slower then the player when he moves...
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Fuzzy » Thu Apr 12, 2007 4:20 am

Sorry. I failed to understand you. Here is a screen cap of the place to find infinite settings.

In the draw event for the midground actor, put this in script event

xvelocity = player.xvelocity-HowMuchSlower;

Fill in HowMuchSlower with whatever amount you want. If HowmuchSlower is greater than player.xvelocity, the midground will travel backwards. If that is a problem, you may want to try this line instead:

xvelocity = (int)player.xvelocity*0.9;

Adjust 0.9 to your tastes. what (int) does is changes a decimal number to a whole number. for example. xvelocity = (int)5*0.9; would set xvelocity to 4, dropping the 0.5 part of 4.5.

Thats it.
Attachments
SelectInfinite.png
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

thanks!

Postby d-soldier » Thu Apr 12, 2007 4:36 am

Thank you very much Fuzzy! I spent over three hours working on it myself and got it working a different way, but something doesnt look right when the player jumps (cant put my finger on it yet) so I'll try your way out. I appreciate you taking the time to not only do it yourself but also screengrab/etc. for me. Thanks!
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron