Pages: 1
Topic closed
Basically i am making a mario type game and i want my sprite to move and jump to the left and the right without being really jerky and i want it too be smooth. I also want to know how if i jump ontop of a box that i stay on there and no go back to the ground . Please help.
Offline
Simplest way for collision would be colour sonsing, and for good movement use velocity.
when gf clicked forever if <key [right arrow v] pressed?> if <(xvel) < (maxspeed)> change [xvel v] by (13) end end if <key [left arrow v] pressed?> if <(xvel) > ((maxspeed)* (-1))> change [xvel v] by (-3) end end if <key [up arrow v] pressed?> set [yvel v] to (-5) wait until <touching (ground colour)?> end if <<not<touching (ground colour)?>> and <(yvel) = (0)>> change [yvel v] by (-2) end if <<touching (ground colour)?> or <touching (colliding colour)?>> set [yvel v] to (0) end change x by (xvel) change y by (yvel) set [xvel v] to ((xvel) * (0.87)) set [yvel v] to ((yvel) * (0.87))EDIT: For a scroller you'd just change scrollx instead of x positions
Last edited by zammer990 (2012-07-01 11:35:47)
Offline
Topic closed
Pages: 1