mercredi 22 juin 2016

Several enemy movements in game development

I am writing a simple shoot'em up game in Java using LibGDX as the main library. I would like that any enemy in the game could perform any sort of movement, regardless their type. The problem arises when trying to isolate the logic of the movements an IA from each Enemy class.

A more graphic example:

  1. Mov A: Linear, from top to bottom.
  2. Mov B: Chase player character
  3. Mov C: Show up, shoot and flee.

Enemies:

  1. Spider. Perform Mov A
  2. Another spider. Perform Mov B
  3. To sum up: Being able to assign moves regardless the enemy.

What would be the best approach?

Aucun commentaire:

Enregistrer un commentaire