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

GM8 Water Splash Issue


Recommended Posts

At the moment, I'm porting Water from the old Sonic Dash engine into the Sonic Revival Engine.

Things were goings smoothly as I've got the water physics added and Sonic can run on top of the water. Then I ported over the splash effect.

The splash sort of works but whenever Sonic Jumps when he's above the water, the splash will appear on the waters surface even though Sonic hasn't been submerged. Since it's in the Step event, it's repeated and it happens when Sonic's gaining height or when he's falling.

I'm not familiar with the Sonic Dash engine so does anyone know which variable or line of code I need from the dash enginr to stop the repeated splash effect?

This is the splash code from Sonic Dash that I'm using.

   if (global.water == true && (abs(y_speed)>=3)
&& ((y>global.water_height && previous_y<global.water_height)
^^ (y<global.water_height && previous_y>global.water_height)))
{
var dummyWaterSplash;

dummyWaterSplash = create_particle(x,global.water_height+2,sprWaterSplash,-1,0.5);
dummyWaterSplash.depth = -500;
sound_play(sndWaterSplash);
}[/CODE]

Link to comment
Share on other sites

At the moment, I'm porting Water from the old Sonic Dash engine into the Sonic Revival Engine.

Things were goings smoothly as I've got the water physics added and Sonic can run on top of the water. Then I ported over the splash effect.

The splash sort of works but whenever Sonic Jumps when he's above the water, the splash will appear on the waters surface even though Sonic hasn't been submerged. Since it's in the Step event, it's repeated and it happens when Sonic's gaining height or when he's falling.

I'm not familiar with the Sonic Dash engine so does anyone know which variable or line of code I need from the dash enginr to stop the repeated splash effect?

This is the splash code from Sonic Dash that I'm using.

   if (global.water == true && (abs(y_speed)>=3)
&& ((y>global.water_height && previous_y<global.water_height)
^^ (y<global.water_height && previous_y>global.water_height)))
{
var dummyWaterSplash;

dummyWaterSplash = create_particle(x,global.water_height+2,sprWaterSplash,-1,0.5);
dummyWaterSplash.depth = -500;
sound_play(sndWaterSplash);
}[/CODE]

Dont put the code in the 'normal' Step event. Putting it there would loop the actions no matter if he's in the water or not. Place it in the 'End Step' event.

Link to comment
Share on other sites

@MalcomX: Sorry. I should have been more precise when I said step event. It's already in the End step event. Also it's the same result for any step event.

@SaitoSan: I'll give that a try.

Edit: It works but theres one issue with the splash repeating if Sonic is at the collision point. I can fix that. Thanks for the help guys

Link to comment
Share on other sites

  • Recently Browsing   0 members

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