Discuss Scratch

Uusratcher
Scratcher
21 posts

How do I make a enemy follow the player?

How do I make a enemy follow the player?
All I can do:
whenclickedpointtowards player

Last edited by Uusratcher (Jan. 28, 2024 13:48:05)

chippysmall4
Scratcher
1000+ posts

How do I make a enemy follow the player?

Uusratcher wrote:

How do I make a enemy follow the player?
All I can do:
whenclickedpointtowards player
Try
whenclickedforeverpointtowardsplayermove4steps
This is a simple script
Ask if you want a more complex one
Like enemy ai

Last edited by chippysmall4 (Jan. 28, 2024 14:02:14)

Uusratcher
Scratcher
21 posts

How do I make a enemy follow the player?

Complex, script is to not following player.
chippysmall4
Scratcher
1000+ posts

How do I make a enemy follow the player?

Uusratcher wrote:

Complex, script is to not following player.
No, Player Following Can Be VERY Complex
chippysmall4
Scratcher
1000+ posts

How do I make a enemy follow the player?

Uusratcher wrote:

How do I make a enemy follow the player?
All I can do:
whenclickedpointtowards player
Also, use clones not Sprites When Adding Multiple enemies
Ask if you want the cloning scripts
Uusratcher
Scratcher
21 posts

How do I make a enemy follow the player?

No clone scripts.

Last edited by Uusratcher (Jan. 28, 2024 18:32:10)

Uusratcher
Scratcher
21 posts

How do I make a enemy follow the player?

And Enemy AI.
The_playerisHappy
Scratcher
21 posts

How do I make a enemy follow the player?

whenclickedforeverpointtowardsplayermove3steps

Would this work?
The_playerisHappy
Scratcher
21 posts

How do I make a enemy follow the player?

In a Platformer, try this?

whenclicked
waituntilnotxposition=directionandyposition=direction
setspeed xto
setspeed yto

This probably won’t work since it hasn’t been tested. But just an idea to try!
Uusratcher
Scratcher
21 posts

How do I make a enemy follow the player?

Non-platform.
Emeraldore12
Scratcher
100+ posts

How do I make a enemy follow the player?

You need the enemy to point towards the player,

whenclickedrepeat100pointtowardsplayermove10steps

Or you can use the glide block,

glide10secstox:x positionofplayery:y positionofplayer
-x-Sunny-x-Days-x-
Scratcher
22 posts

How do I make a enemy follow the player?

whenclickedforeverpointtowardsplayermove...steps

If anything else then I need a link
Uusratcher
Scratcher
21 posts

How do I make a enemy follow the player?

Something else.
cs2722201
Scratcher
100+ posts

How do I make a enemy follow the player?

I have used this before for my projects. This is very good for scrolling projects but works with non-scrollers as well.

whenclickedforeverpointtowardsplayerchangexbyroundsinofdirection*speed/1changeybyroundcosofdirection*speed/1

Last edited by cs2722201 (Jan. 29, 2024 13:20:48)

LP372
Scratcher
1000+ posts

How do I make a enemy follow the player?

its laggy, but try glide
BigSus2
Scratcher
86 posts

How do I make a enemy follow the player?

How exactly do you want it to follow the player? Specifics would be helpful.
Malicondi
Scratcher
1000+ posts

How do I make a enemy follow the player?

cs2722201 wrote:

I have used this before for my projects. This is very good for scrolling projects but works with non-scrollers as well.

whenclickedforeverpointtowardsplayerchangexbyroundsinofdirection*speed/1changeybyroundcosofdirection*speed/1
this script is literally point in dir of player an move 1 step towards, and to help op, what kind of following the player?
spiderman010101
Scratcher
4 posts

How do I make a enemy follow the player?

Here is a complex example of enemies following the player https://scratch.mit.edu/projects/948688086/ . The enemies are from Griffpatch, so, well, its complex.
Malicondi
Scratcher
1000+ posts

How do I make a enemy follow the player?

spiderman010101 wrote:

Here is a complex example of enemies following the player https://scratch.mit.edu/projects/948688086/ . The enemies are from Griffpatch, so, well, its complex.
yeah that ai uses grid lists to pathfind to the desired point, griffpatch has 2 tutorials on how to do it
Uusratcher
Scratcher
21 posts

How do I make a enemy follow the player?

cs2722201 wrote:

I have used this before for my projects. This is very good for scrolling projects but works with non-scrollers as well.

whenclickedforeverpointtowardsplayerchangexbyroundsinofdirection*speed/1changeybyroundcosofdirection*speed/1
There is no speed circle block in scratch.

Last edited by Uusratcher (Jan. 30, 2024 02:18:20)

Powered by DjangoBB