Well, what if you also made it so that in order to jump, Player Flag 1 has to also be set to ON. Then you can add another line like "if Player top detector overlaps the background (i.e. hits his head on the ceiling or whatever) set Player Flag 1 to OFF." You'd have to work gravity in there still, maybe use another flag? I'm new at this too but it may work.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Set up the way xerus said to use an alt value for Y movement .
Always ->
start loop "jump" Abs(AltValA("Player")) times
on loop "jump"
+ bottom detector is not overlapping a backdrop
+ AltValA("Player") > 0 ->
Set Y position to Y("Player)+1
on loop "jump"
+ top detector is not overlapping a backdrop
+ AltValA("Player") < 0 ->
Set Y position to Y("Player)-1
This does gravity too though. A fastloop run 30 times is as good as moving 30 pixels in a frame, so the always event keeps it at MMF drawable speed if you will .
As always someone is free to correct me but i think this should work, it did in an engine i made anyway...
Slink, the typical proceedure is to check for collisions every loop, then when there is one, back up the character 1 pixel (So it's not overlapping the wall) and do the stop loop.
Ben, that looks fine, but I think its confusing to call that loop "jump" I would name it something like "moveY" or something like that, since its taking care of all actions that could possibly move the player on the y axis.
The reasoning for the fast loops is pixel perfect collision. If you were to move your player at a ridiculous speed, say 60 pixels per frame, without fast loops, you're probably going to pass through backdrops and other actives since you'll skip right over them. But with a fast loop moving the player 1 pixel 60 times per frame, each pixel of movement checks for a collision, and you wont see the next frame until after that fast loop is done-- so you get the same thing, but with accurate collisions. Plus, you dont have to worry about pushing the player out of walls too much since the deepest they can go is 1 pixel.
I remember going through custom platform tutorials when I first was getting into MMF, and I was always so confused as to why people always named their player's y speed value "Gravity." That totally messed with me :I