Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Turning into wall and moving forward gets laggy
- jarscratch1111
- Scratcher
100+ posts
Turning into wall and moving forward gets laggy
The collision I made is very glitchy https://scratch.mit.edu/projects/630959125/. when turning into a wall or bumping into a wall it becomes very laggy.
Last edited by jarscratch1111 (Jan. 23, 2022 19:10:27)
- Rangnarok
- Scratcher
29 posts
Turning into wall and moving forward gets laggy
I think you should do a different collision test that goes like this:
when green flag clicked
forever
if <key [up arrow] pressed?> then
move (10) steps
if <touching [wall] ?> then
move (-10) steps
end
end
if <key [right arrow] pressed?> then
turn cw (10) degrees
end
if <key [left arrow] pressed?> then
turn ccw (10) degrees
end
if <key [down arrow] pressed?> then
move (-10) steps
if <touching [wall] ?> then
move (10) steps
end
end
end
Last edited by Rangnarok (Feb. 12, 2022 20:58:11)
when green flag clicked
forever
play [Minecraft]
play [Hollow Knight]
play [Undertale]
play [Deltarune]
play [TLoZ BotW]
play [TLoZ TotK]
play [It Takes Two]
play [Geometry Dash]
play [Terraria]
code [Scratch]
code [C#]
end
when [russia] > [ukraine]
if <[russia] invades [ukraine] ?> then
repeat until <([state] of[russia]) = [peace]>
̶p̶e̶n̶ foot down
replace item [state] of [putin] with [snitch]
globally [protest]
end
end
RUUUUNNN ITS THE EVIL KUMQUATS
You didnt need to scroll all the way down here btw…
- aaroj123
- Scratcher
38 posts
Turning into wall and moving forward gets laggy
This should work more smoothly
https://scratch.mit.edu/projects/643443542/
All changes are in the player sprite
the issue is in the move steps out of wall block
https://scratch.mit.edu/projects/643443542/
All changes are in the player sprite
the issue is in the move steps out of wall block
——————————————
Coding
Making stuff
Helping with scripts
——————————————
——————————————
- jarscratch1111
- Scratcher
100+ posts
Turning into wall and moving forward gets laggy
This should work more smoothlyhttps://scratch.mit.edu/projects/643454585/ this is your solution
https://scratch.mit.edu/projects/643443542/
All changes are in the player sprite
the issue is in the move steps out of wall block
- jarscratch1111
- Scratcher
100+ posts
Turning into wall and moving forward gets laggy
This should work more smoothlyhttps://scratch.mit.edu/projects/630959125/ your solution
https://scratch.mit.edu/projects/643443542/
All changes are in the player sprite
the issue is in the move steps out of wall block
I think you should do a different collision test that goes like this:https://scratch.mit.edu/projects/630959125/ your solotionwhen green flag clicked
forever
if <key [up arrow] pressed?> then
move (10) steps
if <touching [wall] ?> then
move (-10) steps
end
end
if <key [right arrow] pressed?> then
turn cw (10) degrees
end
if <key [left arrow] pressed?> then
turn ccw (10) degrees
end
if <key [down arrow] pressed?> then
move (-10) steps
if <touching [wall] ?> then
move (10) steps
end
end
end
Last edited by jarscratch1111 (Feb. 12, 2022 22:46:08)
- Discussion Forums
- » Help with Scripts
- » Turning into wall and moving forward gets laggy