I have been looking for ways to move,jump,fall,walk on stuff and fly any suggestions?
Offline
Moving around and jumping are completely different for each project. If you are making a scrolling platformer, scrolling, collision detection and an xpos variable will need to be implemented. If it's a non-scrolling platformer, you'll need collision detection. However, if it's just a character moving around a screen, then it'll be easy: The simplest way of doing this is direct movement, which uses this script:
when gf clicked forever if <key [up arrow v] pressed?> change y by (1) end if <key [down arrow v] pressed?> change y by (-1) end if <key [left arrow v] pressed?> change x by (-1) end if <key [right arrow v] pressed?> change x by (1) end end
Offline
This should do it.
when gf clicked set [x v] to (0) set [y v] to (0) forever if<key [right arrow v] pressed?> change [x v] by (0.2) end if<key [left arrow v] pressed?> change [x v] by (-0.2) end change x by (x) if <touching [wall or floor sprite v]?> set [x v] to ((-0.5)*(x)) change x by (x) if <touching [wall or floor sprite v]?> change x by (x) end end if<key [space v] pressed?>// fly up when space is pressed change [y v] by (0.2) end change [y v] by (-0.1) change y by (y) if<touching [wall or floor sprite v]?> set [x v] to ((x)*(.98)) // friction on the ground set [y v] to ((-0.5)*(y)) change y by (y) if<touching [wall or floor sprite v]?> change y by (y) end if<<key [up arrow v] pressed?> and <(y) > (0)>> set [y v] to (5) end else set [x v] to ((x)*(.99)) // less friction if you're in the air end
Offline
this dosen't work=(
Offline
I helped whiteflame115 with something similar to this. Anyway, at the end of one of Whiteflame115's topics, I made a guide on making sensors for platformers as well as how to make your character move and not run through walls. Just to warn you, it might be a bit complicated, and also remember that the my tutorial is at the end of it. Anyway, here's a link to the topic:
how to make a sprite move up a diagonal line?
Just to let you know, my tutorial doesn't have everything in it. For example, if you were only using my scripts, then you could jump through ceilings, but that can be avoided with the right scripts.
Anyhow, I hope that this helps!
Last edited by ErnieParke (2012-08-06 17:06:14)
Offline
You use the go to script.
go to x:(0):y(0)
Last edited by maxamillion321 (2012-08-07 19:52:22)
Offline
maxamillion321 wrote:
You use the go to script.
go to x:(0):y(0)
Fixed:
go to x: (0) y: (0)
Offline
nonsense
Offline
JamieBruce wrote:
this dosen't work=(
Unless I'm misunderstanding what you're asking, it does work; I uploaded an example here
Offline
ErnieParke wrote:
JamieBruce wrote:
nonsense
What do you mean by "nonsense"?
just player controlled not auto game!
Offline