Hello, working on a side scroll shoot em up. How do I make my enemies shoot at the current location of the player? Thanks.
Hi, after you create your bullet/laser you can use the “Add a force to move toward an object” action.
This is what my code looks like now. I just want enemy3 to shoot at the player, enemy2 is fine to just shoot straight ahead. How would I change this expression to also add a force? or do I need another expression?
Ok, you are using the fire FireBullet extension. Instead of choosing “Fire a bullet” for enemy3 you can select “Fire a bullet toward a position”. Here you can set the Target X and Y position instead of the angle.
I’m confused. Would you be able to send a picture? Sorry, coding does not come easy to me.
Have you tried firing bullets after creating bullets?
I don’t know how to do that?
You can search for ‘fire a bullet’.
There you have two options:
And then you just fill out the form (you just have to set the specifics for the X and Y position → e.g. enemy.X(“muzzle”) or player.X(“Center”) )
Does that go on the conditions side or the actions side? Sorry.
It is an action and goes to action side
Actions. The condition might be a specific distance between player and enemy. But that’s up to you.
Ok. When I search for fire a bullet, I only get one choice. I don’t see the fire a bullet toward a position option.
You are searching in the condition, search in actions
Yeah, even in the actions I still only get one choice. I’m using the 8 bit space shooter template. Is there a reason it would be missing?
I just checked it and the action is definitely missing in the space-shooter example.
Ok. Is there a way to add it? or no.
I just realized that you can update the extension and the two options will be available.
Ok. Your last code almost worked, although only some of my enemy3 were shooting the others weren’t. How do I update the extension? Thanks for all your help.