GMS2 Tutorial - Enemy AI - Ships Shoot Back - GameMaker Studio 2 Tutorial
 
Hello everyone, in this GameMaker Studio 2 Tutorial video we'll take a look at one way to create enemy AI. I'll show you how I made another enemy ship that will fire lazers back at the player instead of going kamekazi into the player. There are hundreds of ways to do this and this is a very simple method. In future videos we'll look at how to do this using the physics engine, but in this game we're not using physics. Instead we're using a practical application of built in keywords and functions. Some of this is review for those who missed other episodes, but there are some new functions as well. We create a new sprite and animation from a previous one using the duplicate function built into the engine. We also duplicate some objects and change them to allow them to work differently. Like the enemy ship object and the player's lazer object, which gets reworked to go from the new enemy ship to the player, with a slower speed and more variance. You can tweak all of these numbers to manipulate the difficulty of the game.