Chaos-Fusion Posted January 3, 2012 Report Share Posted January 3, 2012 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 More sharing options...
SaitoSan Posted January 3, 2012 Report Share Posted January 3, 2012 If i still remember game maker then you should probably add a collision code to detect the top of the water or you can make 2 objects which is the top and the bottom part making it only collide with the 1st object creating it there. Link to comment Share on other sites More sharing options...
MalcomX Posted January 3, 2012 Report Share Posted January 3, 2012 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 More sharing options...
Chaos-Fusion Posted January 4, 2012 Author Report Share Posted January 4, 2012 @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 More sharing options...
Recommended Posts