Discuss Scratch

Naoderi
Scratcher
16 posts

How to make Boundaries (using sprites) in Scratch?

I've tried stuff like variables like:

when green flag clicked
forever
set [Player x] to (x position)
set [Player y] to (y position)
if <touching [Boundary] ?> then
go to x: (Player x) y: (Player y)
end

but for some reason it's not working, I've been toying with hitboxes and everything
plz help

Last edited by Naoderi (July 18, 2021 09:37:20)


You're on your own, Noble… Naoderi out.
ProgrammerDE
Scratcher
100+ posts

How to make Boundaries (using sprites) in Scratch?

Look at this post:

https://scratch.mit.edu/discuss/topic/521435/?page=1#post-5341416

It has the same issue. The working one is here.



























































I bet you have the extension



































Nothing here

















There is really nothing down here, stop looking










MasterofTheBrick
Scratcher
1000+ posts

How to make Boundaries (using sprites) in Scratch?

Have you made sure that the player costume is centered in the editor? If yes, then you need to insert the movement code here:

when green flag clicked
forever
set [Player x] to (x position)
set [Player y] to (y position)
movement code ::grey
if <touching [Boundary] ?> then
go to x: (Player x) y: (Player y)
end

instead of running it separately in another loop somewhere else inside your project.

Last edited by MasterofTheBrick (July 18, 2021 11:28:57)

Powered by DjangoBB