Enemy from my 2D platformer with State Machine. Entity have "Animator" "Rigidbody2D" and "EntityFX" components which Enemy Inheritence. Enemy "Skeleton" in this case have 4 Stances Idle,Move,Battle,Attack. He is moving and when he reach corner play Idle animation and then flip and move to the other direction. When player is less distance then "attackDistance" which is 2f, then Enemy will change state to AttackState, if he cannot reach player or player left from his sight then after 12sec. he will come back to MoveState.
GamedevBranislav/Enemy_Entity_Repo
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|