Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Moving Steps
- CodeNerdCO
-
100+ posts
Moving Steps
https://scratch.mit.edu/projects/560490510/ When you run the project, make your way forward. If you get close enough to the enemy, it will move toward you. It is set to move 5 steps, but it seems to move WAY more than 5 steps. Why? Please help.
- griefercube
-
500+ posts
Moving Steps
Try using this instead of the move 5 steps
change [x v] by (([sin v] of (direction)) * (5))
change [y v] by (([cos v] of (direction)) * (5))
![](https://assets.scratch.mit.edu/get_image/.%2E/21eed3848178058ac95ebb2c51268e3f.png)
sometimes, you just have to change a way of thinking to solve a problem. -griefercube
|other projects■how I made the banner■animated thumbnails?■i’m on wiki!■Cubey Mines|
|other projects■how I made the banner■animated thumbnails?■i’m on wiki!■Cubey Mines|
Last edited by griefercube (32th Undecimber, XXXX)
https://turbowarp.org/563693837/editor (something i did a while back don’t worry it’s for the banner)
list of working bbcodes:
[color=]
[scratchblocks]
[url=]
[img]
[center]
[code]
[code=]
[list]
[quote]
[b]
[i]
[u]
[s]
[big]
[small]
[p]
[wiki]
[google]
- deck26
-
1000+ posts
Moving Steps
Please identify the sprite and script you're referring to.
- awesome-llama
-
1000+ posts
Moving Steps
It's because your enemy movement is split into two forever loops and there are situations where both loops are moving the enemy at the same time. If the enemy is following the player, you need to make sure that it isn't doing it's idle movement still. Note that you have repeat () loops which may still be running when the enemy changes to following the player.
- Discussion Forums
- » Help with Scripts
-
» Moving Steps