|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlocation.GameLocation
public class GameLocation
This class reprsents a location with all its contents.
Constructor Summary | |
---|---|
GameLocation(java.lang.String name,
java.lang.String bshName,
java.lang.String xmlFile,
java.lang.String bshScriptFile,
java.lang.String pathBGImg,
java.lang.String imgWalkable,
java.lang.String bgMusicFile,
int scale,
com.golden.gamedev.engine.BaseLoader bsLoader,
com.golden.gamedev.engine.BaseInput bsInput,
com.golden.gamedev.engine.BaseAudio bsSound,
com.golden.gamedev.engine.BaseAudio bsMusic)
Creates a new game location with the specified parameters |
Method Summary | |
---|---|
void |
addCharacter(NPCSprite character)
Adds a character to the location. |
void |
addExit(java.lang.String name,
java.lang.String bshName,
double x,
double y,
int width,
int height,
double newX,
double newY,
boolean usable,
GameLocation destination)
Adds an exit to the game location with the specified parameters |
void |
addInteractiveHotspot(InteractiveHotspot hs)
Adds an interactive hotspot to the game location |
void |
addItem(Item item)
Adds an item to the game location |
void |
addPlayer(Player player)
Adds the player character to the game location |
void |
addProp(Prop prop)
Adds a prop to the list of props of this game location |
java.lang.String |
getBshName()
Returns the beanshell name for this game location |
java.util.ArrayList<LocationExit> |
getExits()
Returns the list of exits of this game location |
java.util.ArrayList<InteractiveHotspot> |
getInteractiveHotspots()
Returns a list with the interactive hotspots of the game location |
java.util.ArrayList<Item> |
getItems()
Return a list with all the items of the game location |
java.lang.String |
getMusicFileName()
Returns the path+file name of the background music theme of this game location |
java.lang.String |
getName()
Returns the name of the game location |
java.util.ArrayList<NPCSprite> |
getNonPlayerCharacters()
Returns a list containing the characters of the location. |
SearchGrid |
getPathSearchGrid()
Returns the path search grid with the current state of the grid |
Player |
getPlayer()
Returns the player object in the game location |
java.util.ArrayList<Prop> |
getProps()
Return a list with all the props of the game location |
float |
getScaling()
Returns the scaling factor for the game location's characters |
java.lang.String |
getScriptFileName()
Returns the path+filename of the beanshell script file assigned to this game location |
com.golden.gamedev.engine.BaseAudio |
getSoundRenderer()
Returns the object responsible for playing sounds of the game location |
java.lang.String |
getXMLFileName()
Returns the path+filename of the xml file assigned to this game location |
void |
initSearchGrid()
Initializes the search grid for pathfinding. |
boolean |
isActive()
Determines wheter this is the location that is currently shown |
void |
playMusic(boolean loop)
Starts to play the assigned background music for this game location |
void |
playMusic(java.lang.String musicPath,
boolean loop)
Starts to play the specified music file |
void |
playSound(java.lang.String filePath)
Plays a sampled sound file once |
void |
removeCharacter(NPCSprite character)
Removes a non player character from the game location |
void |
removeItem(Item item)
Removes an item from the game location, for example if the player picked it up |
void |
removePlayer()
Removes the player from this game location |
void |
render(java.awt.Graphics2D g)
Renders the content of the game loaction |
void |
setActive(boolean active)
Enables or disables the game loaction. |
void |
setBackground(java.lang.String pathBGImg)
Sets the background of the game location to the specified background |
void |
setIntermissionScreenDiabled()
Disables the intermission screen. |
void |
setIntermissionScreenEnabled(java.lang.String imgPath)
Sets an intermission screen that can be rendered instead of the usual game location content |
void |
update(long elapsedTime)
Updates the content of the game location |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GameLocation(java.lang.String name, java.lang.String bshName, java.lang.String xmlFile, java.lang.String bshScriptFile, java.lang.String pathBGImg, java.lang.String imgWalkable, java.lang.String bgMusicFile, int scale, com.golden.gamedev.engine.BaseLoader bsLoader, com.golden.gamedev.engine.BaseInput bsInput, com.golden.gamedev.engine.BaseAudio bsSound, com.golden.gamedev.engine.BaseAudio bsMusic)
name
- name of the game locationbshName
- beanshell name for useage in beanshell script filesxmlFile
- path+file name of the assigned xml filebshScriptFile
- path+filename to beanshell script file for
this game location. Call setUpBshScript() after the game loactions has
been fully instantiated with characters and itemspathBGImg
- path to the background image for the loactionbgMusicFile
- path+file name to music filescale
- sacling factor for the characters in the locationbsLoader
- bsInput
- bsSound
- Method Detail |
---|
public java.lang.String getXMLFileName()
public java.lang.String getScriptFileName()
public java.lang.String getMusicFileName()
public java.lang.String getName()
public java.lang.String getBshName()
public float getScaling()
public void setBackground(java.lang.String pathBGImg)
pathBGImg
- path+filename of the new background imagepublic void setIntermissionScreenEnabled(java.lang.String imgPath)
imgPath
- path+filename to the intermission screen imagepublic void setIntermissionScreenDiabled()
public void initSearchGrid()
public SearchGrid getPathSearchGrid()
public void playMusic(boolean loop)
loop
- loop the music? --> true=yes, false=nopublic void playMusic(java.lang.String musicPath, boolean loop)
musicPath
- path+filename to music file to playloop
- loop the music? --> true=yes, false=nopublic void playSound(java.lang.String filePath)
filePath
- path+filename of the sound file to playpublic com.golden.gamedev.engine.BaseAudio getSoundRenderer()
public void addItem(Item item)
item
- item to add to the game locationpublic void removeItem(Item item)
item
- the item to removepublic java.util.ArrayList<Item> getItems()
public java.util.ArrayList<Prop> getProps()
public void addProp(Prop prop)
prop
- prop to add to the game locationpublic void addCharacter(NPCSprite character)
character
- non player character to add to the locationpublic void removeCharacter(NPCSprite character)
character
- the character to removepublic void addInteractiveHotspot(InteractiveHotspot hs)
hs
- interactive hotspot to add to the game locationpublic java.util.ArrayList<InteractiveHotspot> getInteractiveHotspots()
public java.util.ArrayList<NPCSprite> getNonPlayerCharacters()
public Player getPlayer()
public void addPlayer(Player player)
player
- player objectpublic void removePlayer()
public void addExit(java.lang.String name, java.lang.String bshName, double x, double y, int width, int height, double newX, double newY, boolean usable, GameLocation destination)
name
- name of the exitbshName
- beanshell name for the location exitx
- x-coordinatey
- y-coordinatewidth
- width of the exitheight
- height of the exitnewX
- new x-coordinate for the playernewY
- new y-coordinate for the playerusable
- determines if the exit can be initially useddestination
- the destination game location this exit leads topublic java.util.ArrayList<LocationExit> getExits()
public boolean isActive()
public void setActive(boolean active)
active
- activate location (true) or deactive location (false)public void update(long elapsedTime)
elapsedTime
- time between two framespublic void render(java.awt.Graphics2D g)
g
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |