How to make enemies follow and shoot player

I’m trying to make a wave-based game where enemies will go toward the player and try to shoot the player. I really just need to know how to make the enemy following/ attacking you. I know the emitter can be used to make the shooting, just not how to do the other part. Help :slight_smile:

i have something that can help you @Wrizzler23

https://youtu.be/o2EWjy3qARo this can help you @Wrizzler23 and welcome to flowlab community

Thanks I’ll check it out

I found if you take your enemy sprite, and go into behaviors, put a ‘always’ block. Take two ‘extractors’ and set one to X and the other to Y. And then set the extractors to ‘other’ and select the player. Then run the output of the extractors to the ‘angle’ input of the emit.

I just found a problem when I said this! I realized you need to do something else. Here is another version.

I found if you make a new sprite, and go into behaviors, put a ‘always’ block. Take two ‘extractors’ and set one to X and the other to Y. And then set the extractors to ‘other’ and select the player. Then run the output of the extractors to a PointAt. The take a ‘number, once, and alpha’ and put the ‘once’ to the ‘get’ of the number, and then the “%” input of the ‘alpha’. When you want it to shoot, just hook up a timer, or whatever you want to do!

3 Likes

Thanks! that’s exactly what I need too! :slight_smile: I checked out dark defense by the way. Its a good game!

1 Like