Platformer not working?

I'm making a platformer where you wrap around the screen, but your gravity changes if you go through the left or right edge.
The problem is, walking into a wall makes the player go straight to the top. I used griffpatch's platformer tutorial from Scratch, but it doesn't seem to work no matter what I do. How do I fix this?

Couldn't you have a gravity variable then [change yv by (gravity)] then when you touch the edge of the screen (() - (gravity)) so you wouldn't have to keep putting those if-elses?

i guess so, but i'm not an efficient person lol

I did this and it seemed to have fixed it, i don't know how though:

huh, neat

it might have something to do with the fact that i forgot to change the name in the touching boolean? the ground used to be called Sprite, and i forgot to change that specific boolean

When I put the change y block in it just zaps through the floor. or it teleports to the top idk what's happening


and also you don't need that as a global variable since you'll only need slope in that block

well adding that slope block doesnt seem that important since it makes the square walk up walls

No, it is important. It is needed so the player doesn't walk up walls. The problem is you forgot to reset slope back to zero before starting the script so it could start the script with a slope value of 923974712837182612837129871892310923.

when i changed the script, it could walk halfway up a wall

Hm... well I changed the script to that and tested it and it worked perfectly. Maybe you got a variable wrong or something. Try sending a pic of the script so I can find out what the problem is.

the script:
image
what happened when i held up while walking into a wall:
image

your first script seems to work better

that's how I always make x collision in my platformer scripts... well I don't have enough time right now... maybe it could be a different block.

wait did you fix the problem? i opened the project and held up while walking into a wall without changing anything and it works perfectly fine

i fixed it by using your first solution

Oh that's why I couldn't go up the slope in the turtle costume...

But I don't really know why the second script isn't working. The set slope block and the change y block is in the tutorial:
image
And I've always done it that way in Scratch. When I put the one that should work it works in Snap!, too.

Maybe it's device differences or a stray gamma ray or something else uncontrollable.

wait by walking up wall do you mean it slowly climbs up the wall then back down? because if that's the case that's not walking up the wall it's just what's happening in slow motion as you slide on the wall since the block isn't warped. also i forgot to put the warp block onto everything before sharing the script pic so the warp block is on the bottom not sure why you included that

it like, climbed up the wall slowly. then moved down a bit slowly, went up slowly, repeat.

hmmmm..... from what I see, if you fall out the bottom you go to the top, and if this is a glitch then you can bypass levels ez

that's how its supposed to work
if you fall through the bottom, you come out through the top. if you go through the side, you come out on the other side, except your gravity is switched.