Discuss Scratch

firewolf7277
Scratcher
18 posts

Help Fix Glitch Please (I'll give credit on game)

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

There is a glitch where if the penguin jumps on top of the ice cube, they go to the right and then if you jump, they float up and don't come back down. I was wondering if someone could help make it where the ice cube and penguin can jump on top of each other as if they are solid blocks and stack. Thank you and I will give credit to your username and a follow if you want. Project is https://scratch.mit.edu/projects/1292795286 (it would help if you could remix so I could view the code and see what I did wrong. =]
CaliforniaCoders
Scratcher
100+ posts

Help Fix Glitch Please (I'll give credit on game)

its because in the code you are saying if both positions are equal and they are colliding increase both of their y velocitys by 10
CaliforniaCoders
Scratcher
100+ posts

Help Fix Glitch Please (I'll give credit on game)

if <<([Y v] of [penguin v]) < (y position)> or <([Y v] of [penguin v]) = (y position)>> then 


Code that makes y velocity higher
else
code that makes y velocity less
end
thats the issue
firewolf7277
Scratcher
18 posts

Help Fix Glitch Please (I'll give credit on game)

I see what you mean but it doesn't solve the problem of there being no collision when they jump on top of each other.
CaliforniaCoders
Scratcher
100+ posts

Help Fix Glitch Please (I'll give credit on game)

remove the or = and instead only add non set horizontal
define Fix leftcolisions -- run without screen refresh
repeat until <not <touching [penguin v] ?>>
change x by (-1)
end
10goto10
Scratcher
1000+ posts

Help Fix Glitch Please (I'll give credit on game)

I made another remix of your project: https://scratch.mit.edu/projects/1377449214/
I tried to make a new state of existence for the penguin that is true when it is stuck on top of the ice cube.
Seems like it is working. When either the penguin jumps or the ice cube jumps the penguin is put back into the unstuck state.
firewolf7277
Scratcher
18 posts

Help Fix Glitch Please (I'll give credit on game)

Wow i checked that out and that is insane. I would not have been able to find out how to do that. Thank you so much =]

Powered by DjangoBB