Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » sprite that walks to a random position
- L1B33612A
-
6 posts
sprite that walks to a random position
ok so im making a game and i need a sprite to be able to walk to a random area, but run into a wall. i need it to bounce off the wall into another wall. ive tried to make it sense a sprite and bounce off of that sprite, but nothing works. im really bad at coding, anything helps.
- Coder046
-
100+ posts
sprite that walks to a random position
If the wall is the edge, use this:
As far as I know, “bounce” will not only reset the position of the sprite so that it is not edging off the stage, but it will also bounce the direction.
- Detroitman200
-
14 posts
sprite that walks to a random position
You can use the 3.0 glide to random position block.
- deck26
-
1000+ posts
sprite that walks to a random position
Even if you think you are bad at coding it can be useful for us to see what you've tried so we can nudge you in the rigth direction.
- L1B33612A
-
6 posts
sprite that walks to a random position
If the wall is the edge, use this:As far as I know, “bounce” will not only reset the position of the sprite so that it is not edging off the stage, but it will also bounce the direction.
this helps alot, but i want it to bounce off a sprite. thanks for the help! ill do some troubleshooting.
- Coder046
-
100+ posts
sprite that walks to a random position
This does what you want it to. I just came up with this, and it works great!
- Coder046
-
100+ posts
sprite that walks to a random position
It will have some bugs sometimes, though. I tested using an arrow sprite, and when it collided with one of the sides of the point when going forward, it had to bounce far. Other that things like that, I think that this is at least one of the best solutions available.
- Discussion Forums
- » Help with Scripts
-
» sprite that walks to a random position