Package cl.cromer.azaraka.object
Class Key
- java.lang.Object
-
- cl.cromer.azaraka.object.Object
-
- cl.cromer.azaraka.object.Key
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Key.State
The state of the key-
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 boolean
checkPosition(int x, int y)
Check what position the key is located atint
getAnimationWidth()
Get the width of the key animationvoid
getKey()
Get the keyKey.State
getState()
Get the current state of the keyvoid
playGetKeySound()
Play the get key soundvoid
run()
This is run when the thread startsvoid
setSound(Sound sound)
Set the sound the key object will usevoid
setState(Key.State state)
Set the new state of the key-
Methods inherited from class cl.cromer.azaraka.object.Object
changeDirection, drawAnimation, getActive, getAnimation, getCell, getLogger, getScene, getX, getY, loadCharacter, moveDown, moveLeft, moveRight, moveUp, 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
-
getAnimationWidth
public int getAnimationWidth()
Get the width of the key animation- Returns:
- Returns the key animation width
-
playGetKeySound
public void playGetKeySound()
Play the get key sound
-
setSound
public void setSound(Sound sound)
Set the sound the key object will use- Parameters:
sound
- The sound to use
-
getKey
public void getKey()
Get the key
-
getState
public Key.State getState()
Get the current state of the key- Returns:
- Returns the key's state
-
setState
public void setState(Key.State state)
Set the new state of the key- Parameters:
state
- The new state of the key
-
run
public void run()
This is run when the thread starts
-
checkPosition
public boolean checkPosition(int x, int y)
Check what position the key is located at- Parameters:
x
- The x position to comparey
- The y position to compare- Returns:
- Returns true if it is the same position or false otherwise
-
-