Very hard, it includes a few variables and precise coding, I recommend you use some else's
Offline
I wouldn't call it "very hard", but I guess everyone's different.
when gf clicked set [yVelocity v] to [0] forever if <touching color [#dedfdf]?> set [yVelocity v] to [1] else change [yVelocity v] by [-1] end change y by (yVelocity) end
Last edited by RedRocker227 (2012-05-24 15:12:12)
Offline
RedRocker227 wrote:
I wouldn't call it "very hard", but I guess everyone's different.
I thought he ment when things bounce of the walls and stuff and fall at a realistic trajectory
Last edited by Tbtemplex97 (2012-05-24 15:21:32)
Offline
Gravity uses velocity, which can confuse some people. I would recommend using this script:
when gf clicked set [Vel v] to [0] forever if <touching [edge v]?> // Replace this with whatever you use for "If touching ground" set [Vel v] to (((Vel) * (-1)) * (0.2)) if <<(Vel) > (-0.1)> and <(Vel) < (0.1)>> set [Vel v] to [0] end end change y by (Vel) // This "Vel" variable is vertical velocity. set [Vel v] to ((Vel) * (0.83)) endFor a jumping script, you can use this:
When key [up arrow v] pressed set [Vel v] to [10]I hope this helps!
Last edited by SciTecCf (2012-05-24 15:31:51)
Offline
Tbtemplex97 wrote:
RedRocker227 wrote:
I wouldn't call it "very hard", but I guess everyone's different.
I thought he ment when things bounce of the walls and stuff and fall at a realistic trajectory
That's not what I think of when I hear the word "gravity", but okay.
Offline
SciTecCf wrote:
Gravity uses velocity, which can confuse some people. I would recommend using this script:
when gf clicked set [Vel v] to [0] forever if <touching [edge v]?> // Replace this with whatever you use for "If touching ground" set [Vel v] to (((Vel) * (-1)) * (0.2)) if <<(Vel) > (-0.1)> and <(Vel) < (0.1)>> set [Vel v] to [0] end end change y by (Vel) // This "Vel" variable is vertical velocity. set [Vel v] to ((Vel) * (0.83)) endFor a jumping script, you can use this:When key [up arrow v] pressed set [Vel v] to [10]I hope this helps!
I tried it and it didn't work. The sprite kept staying in the air. Can you help me?
Offline
RedRocker227 wrote:
I wouldn't call it "very hard", but I guess everyone's different.
when gf clicked set [yVelocity v] to [0] forever if <touching color [#dedfdf]?> set [yVelocity v] to [1] else change [yVelocity v] by [-1] end change y by (yVelocity) end
Neither did this...
Offline