dot big bang

Developer API
Menu
All
  • Public
  • Public/Protected
  • All

There are two types of enemies supported in this game. NPC enemies are fully animated and can hold objects. Voxel Object Enemies are simpler voxel objects and require some different setup. The game contains both types so you can pretty easily create your own enemies of either type by using ours as a base.

Voxel object enemies have a couple extra optional scripts that let you control their animation since they can't play animations like the NPC enemies.

If you select the Bat enemy on the first island you will see a Voxel Object Animation Controller script and several Voxel Object Animation scripts.

The animation controller script is listening to events from other scripts and playing the animations related to those events. You shouldn't need to make any changes to the animation controller properties unless you are trying to make a more advanced enemy.

Each Voxel Object Animation script defines a specific set of frames for each animation. Looking at the top one you will see the "idle" animation loops frames 1 to 5.

The supported Animation Ids for this game are:

  • idle
  • running
  • falling
  • melee_attack
  • ranged_attack

To work with our system these ids must match exactly, but you can also add your own animation ids and use scripts to play them if you are a more experienced programmer.

When you build your enemy in the Voxel Object Editor you need to add sets of frames for each state in sequence. If you look at the bat in the Voxel Object Viewer you will see it looping through all of its frames. You can remix it to see how we've used the frames for the various states.