Constructing three little enemies

In this game we are going to have three unique types of enemies for the player to fight against: the FloatBot, the SpaceMine, and the Strafer. Each of these enemies will move differently and have a distinct attack. However, there are some common elements that they share, such as they will all have collision with bullets and the player, but not with each other.

It is always useful to think about the commonalities of the various objects as there may be ways to simplify and reduce the amount of work needed. In this case, as we are dealing with collision, we can use a parent object.

Making the enemy parent

Parenting object is an incredibly useful ability in GameMaker: Studio. It allows for one object, the parent, to ...

Get HTML5 Game Development with GameMaker now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.