Manual scroll lags behind

Started by BlackCurtain, March 25, 2012, 07:03:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

BlackCurtain

I'm using a manual parallax scroll for one of my levels and have it follow the y-coordinates of scroll[0] which is set to follow the player. The x-coordinates changes manually when the player moves. But the problem is that scroll[1] which is manual lags behind when the player jumps. How do I make it stick to the y-coordinate of the first scroll? This is what I use to make it follow the y-coordinates:


scroll[1].y0=scroll[0].y0;
scroll[1].y1=scroll[1].y0;

handsource-dyko

Is the first scroll (scroll[0]) automatic? Maybe you could consider making both scrolls manual and/or have both scrolls assigned to the player process.
Do the scrolls use the same region? You can overlap regions if I'm not mistaking.

BlackCurtain

Yes, scroll[0] is automatic and has the camera set to the player id. I've tried setting both scrolls to follow the player, but then the parallax scroll won't scroll or be misplaced.

handsource-dyko

Difficult case...  ::) Years ago I tried something with two scrolls overlapping each other.  But in that design I used to create more levels of parallax and the player was only visible in the topmost scroll. I can't really remember how I exactly did it. But is your intend to create more levels of parallax? Like on the sega megadrive (supports about 7 layers of parallax, and supernes only has about 2 layers, like bennu).

BlackCurtain

Well I have 2 layers of parallax: scroll[0] (foreground set to automatic with no background) and scroll[1] (foreground and background set to manual).

BlackCurtain

Any other suggestions? Here's the code I use for the scroll.



start_scroll(0,gfx_level,1,0,0,4);
start_scroll(1,gfx_level,2,3,0,1|4);

scroll[0].camera=pid;
scroll[1].camera=0;
scroll[1].ratio=0;
scroll[1].y0=scroll[0].y0;
scroll[1].y1=scroll[0].y0;
scroll[1].x0=scroll[0].x0;
scroll[1].x1=scroll[0].x0;

scroll[0].z=pid.z+1;
scroll[1].z=scroll[0].z+1;

handsource-dyko

I see that you use one region for both scrolls. Are sure about

start_scroll(1,gfx_level,2,3,0,1|4);


it looks like you try to draw this scroll on a map, but I think you made a typo there. Maybe you could try to give each scroll it's own region and give both regions the same dimensions and position. Maybe you could also change the speed of the scroll or tinker with the region1 and region2 fields of the scrolls. I really wouldn't know any thing else. Oh, wait, what if you use an cooridinate offset for scoll[1]? A correction value of somting like this:


scroll[1].x=scroll[0].x0+10;
scroll[1].y=scroll[0].y0+10;




BlackCurtain

Quote from: handsource-dyko on March 27, 2012, 02:52:49 PM
I see that you use one region for both scrolls. Are sure about

start_scroll(1,gfx_level,2,3,0,1|4);


it looks like you try to draw this scroll on a map, but I think you made a typo there.
No the last one is the lock indicator parameter.

BlackCurtain

Quote from: handsource-dyko on March 27, 2012, 02:52:49 PM

scroll[1].x=scroll[0].x0+10;
scroll[1].y=scroll[0].y0+10;

That worked pretty good, but kinda jerky. It will have to do for now. Thanks :)

handsource-dyko