I've been trying to figure this out for hours.
Do you have a script to "repel"? When two sprites bump, they move to the other direction.
Offline
It depends on how they move. If you only use the [move (10) steps] block and directions to move your sprites, there's an easy way. Otherwise you need some harder math.
Offline
I want my sprites to move in random direction when they touch as long as that direction is away from the other. Do you know an easier way to do that?
Offline
Sure!
when gf clicked forever wait until <touching [sprite 2 v]?> turn ccw ((pick random (0) to (180)) * (pick random (1) to (2))) degrees move (10) steps
Last edited by Hardmath123 (2012-10-18 08:55:28)
Offline
I fail at scratchblocks
This would repel them in a random direction away from the sprite
when gf clicked forever if <touching [Sprite2 v]?> point in direction ([180] - (direction)) move [-10] steps endFixed on my post- thanks DVD!
Last edited by Willpower (2012-10-18 11:01:24)
Offline
Thank you for the help. I will try feedback tomorrow. It's evening here.
Offline
Willpower wrote:
I fail at scratchblocks
![]()
This would repel them in a random direction away from the spritewhen gf clicked forever if <touching [Sprite2 v]?> point in direction ([180] - (direction)) move [-10] steps end
fixed
Offline
dvd4 wrote:
Willpower wrote:
I fail at scratchblocks
![]()
This would repel them in a random direction away from the spritewhen gf clicked forever if <touching [Sprite2 v]?> point in direction ((180) - (direction)) move (-10) stepsfixed
I fixed it even more.
Offline