@Something That's certainly how I would start thinking about it. You could also take into account the player velocity, and add this to position. That would cause enemies to shoot at where they think you're going to be. You could also reduce/add a random amount to this velocity check so they get it wrong more often than not.
Quick update (pending):
- calmed down turret AI
- extended range of lasers
- added a simple reticle to guide player's aim. Will adjust soon, so it doesn't block the view of lasers!
- added another enemy fighter, just for fun
Update! I now call this a "demo" (upgraded from tech demo).
- ship collisions implemented
- there are now two missions
- progress is saved between missions, and can be loaded from the title screen
- reticle turns red when aimed at a ship
This update has fewer visible changes:
- The AI is improved a little bit. This will be tweaked more and more over the next many coding sessions, but at this stage provides some fun battles.
- I added a third mission as kind of a stress test of the system.
sounds interesring but I'm getting "PROJECT NOT FOUND"
It is awaiting approval
I've been tweaking this gradually over the last while. I think I am "demoting" it back to tech demo, since I do want to add a number of more features before focusing on adding content/levels. This has slightly improved AI over past iterations, but that is something I will ever be tweaking. I also added lighting - something I learned from Game Jam 6!
A little update to report:
- Preliminary homing missiles! Press ZL while the reticle is red over a target. (Work will be done on this, but enjoy infinite missiles for now!)
- Some more tweaks to the AI - it will try to dodge lasers and missiles
- But the AI tweaks have a dark side: On the last (third) mission there is quite a bit of slowdown. I am working out how to fix that!
I made a small update to this, but it is getting closer to a system that I can just add mission content to.
- The player is limited to five homing missiles per mission.
- The missions have a log/dialog system, so that messages come up as the situation changes.
- I rearranged the third mission to avoid the slowdown I was experiencing. It still happens, but is a little less.
- As ever, little AI tweaks. The enemies have their quirks, but I enjoy seeing them chase the player around!