The Bulk Cruiser

Ryan Sweigart
2 min readMay 6, 2021

--

Today I’m showing-off another enemy variant for my little shooter game: The Bulk Cruiser! This beastie is normally a tad slower than the other enemies, and doesn’t fire back. But woe to the player who gets too close: It will turn to face them and charge at full speed!

The Bulk Cruiser inherits the basic Enemy class. It has three states (represented by an enum): Cruising, Tracking, and Ramming. Cruising is the default state, where the Bulk Cruiser behaves like a basic enemy, flying straight down the screen. If the player moves within its detection radius, it switches to Tracking mode.

I see you!

In Tracking mode, the cruiser will rotate in place toward the position it first detected the player. This gives a canny player the chance to move away, but they must still be on their toes, for if the player ever moves in front of the cruiser, it will switch to Ramming mode!

Target Player dead ahead!

Ramming mode is super-simple: The cruiser just heads in the direction it’s facing at an enhanced ramming speed. Eventually the Bulk Cruiser will sense that it is out of the play area, respawn just off the at the top of the screen, and switch back to Cruising mode. A simple AI with a cool effect!

--

--

Ryan Sweigart
Ryan Sweigart

Written by Ryan Sweigart

An independent Unity Developer.

No responses yet