Discuss Scratch

theonlygusti
Scratcher
1000+ posts

Scrolling platformer player walks up sheer cliffs

https://scratch.mit.edu/projects/201364430/

Why does the player move up through the ground?

I only want him to be able to walk up shallow hills, but he's able to climb e.g. vertical walls.

How can I fix this

It's to do with the camera, if the camera remains stationary at 0,0 and doesn't follow the player everything works perfectly, platformer-wise.

But I would like the camera to follow the player, without weird glitches.

Last edited by theonlygusti (Feb. 4, 2018 00:45:28)


Wettining
Scratcher
500+ posts

Scrolling platformer player walks up sheer cliffs

Doesn't seem to be much unnecessary jiggling going on when tried out…
theonlygusti
Scratcher
1000+ posts

Scrolling platformer player walks up sheer cliffs

Wettining wrote:

Doesn't seem to be much unnecessary jiggling going on when tried out…
I fixed the jiggling.

Now the other problem remains:

Why does the player “teleport” up through the ground?

He shouldn't be able to walk up walls or hills that are too steep, but does it consistently.

Wettining
Scratcher
500+ posts

Scrolling platformer player walks up sheer cliffs

theonlygusti wrote:

Wettining wrote:

Doesn't seem to be much unnecessary jiggling going on when tried out…
I fixed the jiggling.

Now the other problem remains:

Why does the player “teleport” up through the ground?

He shouldn't be able to walk up walls or hills that are too steep, but does it consistently.
The problem with walking through the platform is that you're only detecting being on the platform but not underneath it. So only the top of the platform is an actual ‘physical’ thing in your game. A fix would be to use a box collider that follows the body sprite around, detecting whether it is being touched from the bottom, left, right, or top of the sanic head and body sprites.
And for walking up hills that are too steep this might be a fix; turning up the gravity but increasing acceleration should do the trick I believe…
theonlygusti
Scratcher
1000+ posts

Scrolling platformer player walks up sheer cliffs

I don't think that's it Wettining,

e.g. if you remove the “move camera” custom block then the player moves fine, doesn't walk up walls etc.

The problem is a result of the camera moving and the player moving, but I don't know why or how.

Wettining
Scratcher
500+ posts

Scrolling platformer player walks up sheer cliffs

Seems like you fixed it?
It looks great by the way, the graphics look wonderful
theonlygusti
Scratcher
1000+ posts

Scrolling platformer player walks up sheer cliffs

Wettining wrote:

Seems like you fixed it?
It looks great by the way, the graphics look wonderful
I “fixed” it; for some reason still glitches out when in full-screen mode.

Thanks! I'm trying to make an aesthetic project for the first time, paying attention to all the little animations and stuff is fun but tedious. I'll redo all the graphics when I share it for real.

Powered by DjangoBB

Standard | Mobile