Hello!
There's a really good platform base that RHY posted a while ago. If you want, you can download it and take a look at the gravity scripts. Because it's a base for a project, it's perfectly alright if you add your own sprites and levels and upload that!
Here it is: (link)
Offline
jono3814 wrote:
how would you make a sprite jump with gravity in play? without it landing on a obsticle all the time. so you can walk then jump (realistically) using space bar and carry on walking ?
Try something like this:
when gf clicked set [gravity v] to (-0.2) //or whatever you want set x to (0) //or your start position set y to (0) //^^ set [Velocity.X v] to (0) set [Velocity.Y v] to (0) //This is your speed basically forever change x by (Velocity.X) change y by (Velocity.Y) if <touching [level v]?> //or whatever sensing system you're using change y by ((Velocity.Y) * (-1)) set [Velocity.Y v] to (0) else change [Velocity.Y v] by (gravity) end set [Velocity.X v] to ((Velocity.X)*(0.99)) set [Velocity.Y v] to ((Velocity.Y)*(0.99))Hope that helps!
Offline
Simplest method.
when gf clicked forever if <touching [ground v]?> //Your ground. set [yvel v] to [0] if <key [up arrow v] pressed?> set [yvel v] to [5] //You can adjust this number. change y by (5) //Same number as above. end else change [yvel v] by (-0.1) change y by (yvel) end end
Last edited by SciTecCf (2012-07-18 14:42:01)
Offline