I need help you guys, im making a platformer with colour sensors, but if the sprite the player is controlling falls from a distance, half of the sprite is buried in the ground, still able to move side to side, but partly buried. Any help please?
Offline
How about something like this?
when gf clicked forever if <[#ff0000] touching [#00ff00] ?> //where red is bottom-sensor and green in ground. change y by (1) end
Last edited by ManaUser (2012-05-08 12:41:28)
Offline
I tried something like that, but it didn't work.
Offline
make sensor costume slightly closer and instead of 1 Y try 3 Y or something.
Offline
Just use this:
when gf clicked forever if <key [right arrow v] pressed?> change [xvel v] by (1) end if <key [left arrow v] pressed?> change [xvel v] by (-1) end set [xvel v] to ((xvel) * (.87)) change x by (xvel) if <touching [level v]?> change y by (([abs v] of (xvel)) + (1)) if <touching [level v]?> change y by ((0) - (([abs v] of (xvel)) + (1))) change x by ((0)-(xvel)) set [xvel v] to ((xvel) / (2)) end end if <key [up arrow v] pressed?> change y by (-1) if <touching [level v]?> set [yvel v] to (10) end change y by (1) end if <(yvel) < [3]> change y by (-1) if <not<touching [level v]?>> change [yvel v] by (-1) end change y by (1) end set [yvel v] to ((yvel) * (0.9)) change y by (yvel) if <touching [level v]?> change y by ((0) - (yvel)) set [yvel v] to ((yvel) / (2.5)) end endI use it for a lot of my projects and it is really helpful.
Offline