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.