Skip to main content
1 of 2
Gntem
  • 143
  • 6

How to implement tile enemies behavior?

I'm having a difficult time to understand , how to implement the behavior of an enemy in a tile based game,

  • movement
  • attack
  • behavior per enemy level ( higher level enemies should be hard to kill)
  • defend
  • other behavior

since the game is a tile game written in javascript, the behavior of the enemies should be implement as functions like

  • Chaser - hunts its opponents
  • Brave - does not start running if with low HP
  • Sensitive - when damaged might take additional damage

and using the standard entity class , based on the configuration of the enemy, could extend the behavior?

Or write like standard enemy behavior and additionally write separate scripts per enemy on how they should behave against the opponent, surroundings, etc..

Gntem
  • 143
  • 6