Discuss Scratch

Iobro101
Scratcher
18 posts

My cube platformer game glitch

Hi Guys! I have made this topic because I am stuck on a little bit of my cube platformer game and I cannot solve this glitch. Here is the project ( https://scratch.mit.edu/projects/548473361/ ) and it should explain what I need help with here. If you could solve this glitch I would be extremely grateful (and maybe even follow you ) so please have a go. If you don't understand what you need to do you can always leave me a message. Thank you for reading this and bye. This glitch is now solved but scroll down the reply's to help me with a new glitch.


Iobro101

Last edited by Iobro101 (July 1, 2021 17:36:36)

Thingied
Scratcher
1000+ posts

My cube platformer game glitch

The problem is that it keeps on moving the sprite back to -157,-37. To fix this we make it only able to execute once until the next level.

You have to reset the “reset?” variable every time the green flag is clicked and when the player passes on to the next level so that it can reset again.


But now the ground detection is broke on level 2 so just have one loop instead of two and it fixes it.
Iobro101
Scratcher
18 posts

My cube platformer game glitch


Thingied wrote:

The problem is that it keeps on moving the sprite back to -157,-37. To fix this we make it only able to execute once until the next level.

You have to reset the “reset?” variable every time the green flag is clicked and when the player passes on to the next level so that it can reset again.


But now the ground detection is broke on level 2 so just have one loop instead of two and it fixes it.
I've done what you said but the project still isn't working for some reason. Check out the project now. https://scratch.mit.edu/projects/548473361/ It has just changed the positioning for some reason
Thingied
Scratcher
1000+ posts

My cube platformer game glitch

Iobro101 wrote:

Thingied wrote:

-snip-
I've done what you said but the project still isn't working for some reason. Check out the project now. https://scratch.mit.edu/projects/548473361/ It has just changed the positioning for some reason
Forgot to mention to remove this loop.

When it's level 2, it's going to keep running thus making the player stuck near the center. You don't need to put loops around everything, keep that in mind when coding.
Iobro101
Scratcher
18 posts

My cube platformer game glitch

Thank you so much that is excellent but sadly there is another glitch. when you are pressing the right or left arrow key and you walk into the black it sends you back to the start. why?
Thingied
Scratcher
1000+ posts

My cube platformer game glitch

Iobro101 wrote:

Thank you so much that is excellent but sadly there is another glitch. when you are pressing the right or left arrow key and you walk into the black it sends you back to the start. why?
Pretty sure you're running into the lava. Only way I could replicate this.
Iobro101
Scratcher
18 posts

My cube platformer game glitch

Ok thanks

Powered by DjangoBB