I'm making a game called Labyrinth where you are a red dot moving through a literally moving maze collecting treasures within 60 seconds. I am having trouble with rounding a piece's x and y position. Can someone give me a script that rounds the position to every 45 units starting at 22.5? As in make the position random and within 45 countings starting at 22.5 so that the board is 8 by 8 squares. The squares will shift when an arrow is clicked, and when they are out of frame make them go to the opposite side. If you didn't understand what I said then ask questions. It's okay to ask questions!
Offline
You could use this:
X is the X/Y position.
use the following formula:
((X/45)rounded to the nearest whole number) * 45 = NewPosition
This works by using the "round" block's problem: It can only round to whole numbers.
So we divide X by 45, so then we round it, then * it by 45. There's probably an easier way, but there you go.
Offline