Okay so hit tests. Hit tests simply are a check to see if two objects are touching one another. There’s plenty of ways of doing them and every shooter game needs them. AS2 had a nice little function called hitTest, AS3 has two functions…. hitTestPoint and hitTestObject. So what’s new about this hitTestPoint and hitTestObject and which one do you use? We’ll discuss it and how to make our bullets hit enemies and enemy bullets hit us.
All games need enemies…. okay, maybe not tetris. But if you’re in some game where you fly a spaceship it is more than likely that there’s going to be an enemy or two. So in this tutorial we’re going to learn to make our enemy class, making enemies randomly appear on the stage and move, and make them fire bullets at us.