Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Vertical Parallax BG Movement in Dash Engine


OverbounD

Recommended Posts

What's the easiest way to vertically position a background in a room using the Parallax system within the Dash Engine. For example I have a background with several parallax layers including a night sky that I want to stop when the player goes under water at which time it would switch to something else and so on. I've been messing with the parallax system and have yet to figure it out. Little help? Thanks in advance.

Link to comment
Share on other sites

Maybe you can do it using maths. Using the sin function, where 0 is the water coordinate and 90 is the 0 coordinate.

Once you have calculated the angle value with those, just multiply the angle with the position of the bg at top of screen.

I mean,

Imagine you have the water level at y=1000 and a window width of 240, so halfway it's 120;

When the screen top is at 1000-120(880), it means the water is in middle of the screen, so the angle is 0. At screen=0, it means the parralax is completely wide spread, son angle is 90.

So, let's calculate:

angle= 90- (screen_top*90 /880)

Now:

parralax.y = sin(angle)*coeficient - parralax.height.

Where coeficient is the y coordinate of the bottom of the parralax where do'd see it at the very top of the level.;

Link to comment
Share on other sites

Thanks BlueFrenzy but this really just applies to Sonic Dash its got a built in system for handling Backgrounds and I'm looking for help specifically with that not really just how to do it.

I've since figured out how to move the background vertically (yFactor), but I'm attempting to add Damizean's 3D water (ala Hydro City Zone) to that as well. The trouble is that the 3D water is interfering with all backgrounds even the ones using the built in system. I really need some help from someone who understands both these scripts.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...