Package cl.cromer.azaraka.object
Class Enemy
- java.lang.Object
-
- cl.cromer.azaraka.object.Object
-
- cl.cromer.azaraka.object.Enemy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Enemy.Direction
The possible directions the enemy can face-
Nested classes/interfaces inherited from interface cl.cromer.azaraka.Constants
Constants.AIHeuristic, Constants.LogLevel, Constants.PlayerAIType
-
-
Field Summary
-
Fields inherited from interface cl.cromer.azaraka.Constants
AI_HEURISTIC, APPEND_LOGS, CELL_PIXELS, CHESTS, ENEMIES, ENEMY_AI, EXPORT_SCENE, FONT, FONT_SIZE, GENERATE_SCENE, GLOBAL_LOG, HORIZONTAL_CELLS, LOG_TO_FILE, OBSTACLES, PLAYER_AI, PRETTY_JSON, TITLE, VERTICAL_CELLS, VOLUME
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EnemyAI
getAi()
Get the AI in use by the enemyboolean
moveDown()
Move downboolean
moveLeft()
Move leftboolean
moveRight()
Move rightboolean
moveUp()
Move upvoid
run()
This method is run constantly by the runnablevoid
setDirection(Enemy.Direction direction)
Set the direction of the enemyvoid
setSound(Sound sound)
Set the enemy attack sound-
Methods inherited from class cl.cromer.azaraka.object.Object
changeDirection, drawAnimation, getActive, getAnimation, getCell, getLogger, getScene, getX, getY, loadCharacter, setActive, setAnimation, setCell, setLogger, setUseOffset, setXScale, setYScale
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cl.cromer.azaraka.Constants
getLogger, initializeLogger, random
-
-
-
-
Method Detail
-
setSound
public void setSound(Sound sound)
Set the enemy attack sound- Parameters:
sound
- The sound
-
setDirection
public void setDirection(Enemy.Direction direction)
Set the direction of the enemy- Parameters:
direction
- The direction the enemy is facing
-
moveUp
public boolean moveUp()
Move up
-
moveDown
public boolean moveDown()
Move down
-
moveLeft
public boolean moveLeft()
Move left
-
moveRight
public boolean moveRight()
Move right
-
getAi
public EnemyAI getAi()
Get the AI in use by the enemy- Returns:
- Returns the current AI in use
-
-