Discuss Scratch

CodeNerdCO
Scratcher
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
Scratcher
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))


sometimes, you just have to change a way of thinking to solve a problem. -griefercube
|other projectshow I made the banneranimated 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]
CodeNerdCO
Scratcher
100+ posts

Moving Steps

Thanks, but it still does it sometimes
deck26
Scratcher
1000+ posts

Moving Steps

Please identify the sprite and script you're referring to.
awesome-llama
Scratcher
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.


Powered by DjangoBB