Pages: 1
Topic closed
Ok, This Is For A RPG I Am Making On Scratch
1. How Do I Make A Sprite Move Or Glide Towards Another Sprite, Anywhere On The Screen?
2. If You Have Any Other Tips Or Ideas For My RPG Please Tell Me
But First, Please Try Answer 1.
Thanks
HERE IT IS, TELL ME WEATHER TO FINISH IT OR NOT
http://scratch.mit.edu/projects/Lindsay_7321/20182
Last edited by Lindsay_7321 (2007-07-08 15:11:03)
Offline
Movign towards is easy. use the "Poitn towards" command and then use "move x steps". You'll want the point towards and move commands inside a loop, so that it keeps going until it reaches your target.
Repeat until touching "sprite 2"
- Point towards "sprite 2"
- Move forward 10
Offline
Thanks!!!
Offline
Also, How Do I Make Him Switch His Costume If "Sprite 2" Is To The Left Of Him???
Offline
There are a couple of different ways:
1) have an "all sprites" variable that Sprite 2 sets to his x position. compare your x to that variable.
2) point to sprite 2 and check the direction: positive is right and negative is left. If you want to do this without losing your direction, you can use a variable saved_dir
set saved_dir to direction
point towards sprite 2
if direction < 0
set costume to <left costume>
point in direction saved_dir
You'll lose a tiny bit of information, since the Squeak implementation of <direction> rounds the direction (which it shouldn't).
Offline
Topic closed
Pages: 1