Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Help with a project i am making
- StratosphereGlider
- Scratcher
38 posts
Help with a project i am making
I am making a project where you bounce off walls but i am having problems where you glitch trough the walls or my scripts just glitch out entirely. Can someone please look over my scripts.
My project: http://scratch.mit.edu/projects/25784448/
My project: http://scratch.mit.edu/projects/25784448/
Use the force Harry
-Gandalf
- Zacshap21
- Scratcher
100+ posts
Help with a project i am making
I found a bug where you can get stuck inside a wall and you can't move, because you are inside the wall. So to fix it, inside the if touching level script, add a repeat until not touching level block. It should look like this:
Hope this helps!
when green flag clicked
forever
if <touching [level] ?> then
repeat until <not <touching [level] ?>>
set [X momentum] to [((X momentum) - ((X momentum) * (2.5))) ]
set [touching wall] to [1]
end
else
set[touching wall] to (0)
end
end
Hope this helps!
- StratosphereGlider
- Scratcher
38 posts
Help with a project i am making
I found a bug where you can get stuck inside a wall and you can't move, because you are inside the wall. So to fix it, inside the if touching level script, add a repeat until not touching level block. It should look like this:when green flag clicked
forever
if <touching [level] ?> then
repeat until <not <touching [level] ?>>
set [X momentum] to [((X momentum) - ((X momentum) * (2.5))) ]
set [touching wall] to [1]
end
else
set[touching wall] to (0)
end
end
Hope this helps!
Thanks alot it helped a bit but there are still a lot of problems
Use the force Harry
-Gandalf
- Discussion Forums
- » Help with Scripts
- » Help with a project i am making