Discuss Scratch

monk1122a
New Scratcher
2 posts

cant figure out how to get my sprite to randomly move without ever touching my platform

so as the title says i have a sprite that randomly moves
the code is
when green flag clicked
forever
go to [ random position ]
end
but i dont want it to move to sprite 1 the way i currently have it set up i have a consumable that spawns on it every 3 secs and will glide to the platform the player is on (sprite 1)

does someone have an idea on how to have something constantly teleport without touching a platform
kemlevor
Scratcher
56 posts

cant figure out how to get my sprite to randomly move without ever touching my platform

when green flag clicked
forever
teleport
wait (1) secs
end

define teleport
go to [random position v]
repeat until <not <touching [edge v] ?>>
go to [random position v]
end
set this block to run without refresh

Last edited by kemlevor (Nov. 30, 2025 12:35:53)

monk1122a
New Scratcher
2 posts

cant figure out how to get my sprite to randomly move without ever touching my platform

thanks

Powered by DjangoBB