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

Active object background


icecapboy

Recommended Posts

I think there was a how-to on the main site long time ago, but how would you make an active object backgound follow the main character? (ex:instead of putting many active object backgrounds, use one and act like it's the bg for the whole level.) See,I'm making an underwater level and I don't want to use many active objects that are water which those objects might crash the game.

Link to comment
Share on other sites

Wouldn't making the background an active object force you to have to make the foreground active objects too?

Anyways to do what you want, set the hot spot of the background to [0,0]. Then make an always even that says to position the X to the window left and position the Y to the window top. Window position can be retrieved in the special menu. ( I believe it looks like a wrench )

Link to comment
Share on other sites

  • 2 weeks later...

Um...I'm a bit confused. You want a single active object (as water) to follow Sonic so you don't need to use lots of actives across the level, right?

Create an active object that will act as the water and make it the same size as the game window (320x240, 520x340, etc). Set the hotspot at the top-middle of the object (for a 320x240 game window, that would be 160, 0). Then, go to the event editor and add these events in:

• Always: set X position of water to X position of Sonic

• If Y position of Sonic <= (water level) :

set Y position of water to -500

• If Y position of Sonic > (water level) AND Y position of Sonic < ('water level' + window height ) :

set Y position of water to 'water level' + ( window height / 2 )

• If Y position of Sonic >= ('water level' + window height ) :

set Y position of water to 0

I think that would work. The value of 'water level' can be anything you want; set it to a low value (say, about 500) for a high water level, or set it to a high value for a low water level. 'Window height' is fairly self explanatory - for example, if your game window is 320x240, then the height is 240.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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