I am making a scroller/animation/RPG and I need help making physics for a person in water. I want them to float on the water when nothing is pressed and sink when the down arrow is pressed, but float back up when it isn't. Also when you jump off a heigh height the person should sink, and then float to the surface. PLEASE HELP!!!
Offline
Well I'd first start with a simple float.
When Green Flag is Pressed Forever If Touching Colour Blue Then Change Velocity by 0.1 Else Change Velocity by -0.1 Change Y by Velocity
So this will make your sprite bounce about. Then, you do as follows:
When Green Flag is Pressed Forever If Down Arrow is Pressed Then Change Velocity by -5 Wait 0.2 Else
So now the down arrow decreases Velocity by -5
For jumping, it really depends on your jump system.
Offline
HydraRancher wrote:
Well I'd first start with a simple float.
Code:
When Green Flag is Pressed Forever If Touching Colour Blue Then Change Velocity by 0.1 Else Change Velocity by -0.1 Change Y by VelocitySo this will make your sprite bounce about. Then, you do as follows:
Code:
When Green Flag is Pressed Forever If Down Arrow is Pressed Then Change Velocity by -5 Wait 0.2 ElseSo now the down arrow decreases Velocity by -5
For jumping, it really depends on your jump system.
Thanks that should work well!
Offline
<when green flag clicked>
<forever>
<set{ Y velocity }to(( Y velocity <*> 0.98 ))
That will apply frioction and stop the sprite moving to fast
Offline
skeletonxf wrote:
<when green flag clicked>
<forever>
<set{ Y velocity }to(( Y velocity <*> 0.98 ))
That will apply frioction and stop the sprite moving to fast
are you trying to sound all complicated or something because that won't really change anything
Offline