Package com.starpoints.game
Class LevelInfo
- java.lang.Object
-
- com.starpoints.game.AbstractLevelInfo
-
- com.starpoints.game.LevelInfo
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class LevelInfo extends AbstractLevelInfo implements java.io.Serializable, java.lang.Cloneable
Container for level initializations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description intbackgroundColorThe background color.intbackgroundForeColorThe background forecolor.java.lang.StringbackgroundImageString for a background image.intblackRainProbProbability of black rain starting when entering black points.int[]colorProbRandom colors probabilities.int[]colorsRandom colors.intcyanProbProbability in percent for new items, if a figure enters a cyan point. 18 per default.booleandirectFlashFlag, if no flash fx to next level should be shown.booleandontKillFlag, if the level forbids killing other enemies.java.util.ArrayList<EnemyInfo>enemyInfosList of enemy info.intenemyIQThe enemies iq.intenemySpeedThe enemies speed.intexplosionEnergyLossThe energy a figure will loose while standing on an exploding point per round.intflashAnimationIndex of a flash animation before the level starts.java.lang.String[]fogClassesList of random item infos.intfogdensityThe density of fogs in percent of points per field.int[]fogProbList of fog probabilities.java.util.ArrayList<FogInfo>fogsList of fixed fog info.intgrayEnergyLossThe energy a figure will loose while standing on a gray point per round.booleanhasReplayFlag, if the level shows a replay after a cool play.java.lang.StringhasShopName of a shop is before of level.intheightThe height of the field.intinitialSwirlingRoundsLength of color swirling effect in rounds.booleanisSecretFlag, if level is a secret level.intitemdensityThe density of items in percent of points per field.java.util.ArrayList<ItemInfo>itemsList of fixed item info.booleanlastFigureWinsFlag, if the last living figure wins the level.intlevelColorA color for the level introduction.java.lang.StringlevelSoundLevel sound.java.lang.StringlevelTextLevel text to show during level intro.booleanlooseLivesFlag, if dying in this level costs a live.intmagentaEnergyGainThe energy a figure will gain while standing on a magenta point per round.booleanmakeStartPointsGrayFlag, if the starting points are colored lightgray.java.lang.StringnameLevel name.booleanonlyOnceFlag, if the level is only played once, even if the player does not win.booleanonlyWinnerGetsPointsFlag, if only the winner or every player gets its points added to its point sum.booleanplaceItemsFlag if random items are placed at the beginning of the level.intpointBonusExtraBonus for a point bonus, if a certain level score is reached.intpointBonusLimitLimit for a point bonus, if a certain level score is reached.java.lang.StringpointBonusSoundSound played for a point bonus, if a certain level score is reached.java.lang.StringpointBonusTextString for a point bonus, if a certain level score is reached.java.util.ArrayList<ItemInfo>randomItemsList of random item info.intredHeatGainHeat gain on red points.introundLimitThe round limit for this level.booleanshowLevelPropsFlag, if the level properties are shown before the level starts.booleanshowRoundsFlag, if the round limit should be displayed on the screen.java.lang.StringsoundPathString for an optional subfolder for random sounds.booleanteamModeFlag, if level is played in team mode.intwidthThe width of the field.-
Fields inherited from class com.starpoints.game.AbstractLevelInfo
type
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()intgetEnemyCount()Gets the number of enemies in the level.FieldInfogetField()Gets the FieldInfo.java.lang.StringgetName()Returns the Level name.java.lang.ObjectgetProperty(java.lang.String key)Sets the property with the given key to the value.java.util.List<java.lang.String>getPropertyKeys()Gets a list of all property keys.intgetRandomColor(boolean includeSwirling)Gets a random color depending on the color probability definitions for this level..voidsetField(FieldInfo field)Sets the field info.voidsetProperty(java.lang.String key, java.lang.Object value)Sets the property with the given key to the value.-
Methods inherited from class com.starpoints.game.AbstractLevelInfo
toString
-
-
-
-
Field Detail
-
colors
public int[] colors
Random colors. Default is empty.
-
colorProb
public int[] colorProb
Random colors probabilities. Default is empty.
-
fogClasses
public java.lang.String[] fogClasses
List of random item infos. Default is empty.
-
fogProb
public int[] fogProb
List of fog probabilities. Default is empty.
-
enemySpeed
public int enemySpeed
The enemies speed. Default is 5.
-
enemyIQ
public int enemyIQ
The enemies iq. Default is 80.
-
looseLives
public boolean looseLives
Flag, if dying in this level costs a live. Default is true. Default is true.
-
directFlash
public boolean directFlash
Flag, if no flash fx to next level should be shown. Default is false.
-
levelColor
public int levelColor
A color for the level introduction. Orange per default.
-
itemdensity
public int itemdensity
The density of items in percent of points per field. Default is 15.
-
fogdensity
public int fogdensity
The density of fogs in percent of points per field. Default is 0.
-
width
public int width
The width of the field. Default is 8.
-
height
public int height
The height of the field. Default is 8.
-
explosionEnergyLoss
public int explosionEnergyLoss
The energy a figure will loose while standing on an exploding point per round. Default is 30.
-
grayEnergyLoss
public int grayEnergyLoss
The energy a figure will loose while standing on a gray point per round. Default is 4.
-
magentaEnergyGain
public int magentaEnergyGain
The energy a figure will gain while standing on a magenta point per round. Default is 4.
-
roundLimit
public int roundLimit
The round limit for this level. Default is 250.
-
showRounds
public boolean showRounds
Flag, if the round limit should be displayed on the screen. Default is true.
-
makeStartPointsGray
public boolean makeStartPointsGray
Flag, if the starting points are colored lightgray. Default is true.
-
hasShop
public java.lang.String hasShop
Name of a shop is before of level. Default is null for no shop.
-
onlyWinnerGetsPoints
public boolean onlyWinnerGetsPoints
Flag, if only the winner or every player gets its points added to its point sum. Default is true.
-
backgroundColor
public int backgroundColor
The background color. Default is black.
-
backgroundForeColor
public int backgroundForeColor
The background forecolor. Default is white.
-
initialSwirlingRounds
public int initialSwirlingRounds
Length of color swirling effect in rounds. Default is 150.
-
blackRainProb
public int blackRainProb
Probability of black rain starting when entering black points. Default is 15.
-
redHeatGain
public int redHeatGain
Heat gain on red points. Default is 2.
-
name
public java.lang.String name
Level name. "Arena" is default.
-
placeItems
public boolean placeItems
Flag if random items are placed at the beginning of the level. Default is true.
-
cyanProb
public int cyanProb
Probability in percent for new items, if a figure enters a cyan point. 18 per default.
-
levelSound
public java.lang.String levelSound
Level sound. Default is "flashLevel".
-
lastFigureWins
public boolean lastFigureWins
Flag, if the last living figure wins the level. Default is true.
-
pointBonusText
public java.lang.String pointBonusText
String for a point bonus, if a certain level score is reached. Default is null.
-
backgroundImage
public java.lang.String backgroundImage
String for a background image. Default is null.
-
soundPath
public java.lang.String soundPath
String for an optional subfolder for random sounds. Default is null.
-
pointBonusLimit
public int pointBonusLimit
Limit for a point bonus, if a certain level score is reached. Default is -1.
-
pointBonusExtra
public int pointBonusExtra
Bonus for a point bonus, if a certain level score is reached. Default is 0.
-
pointBonusSound
public java.lang.String pointBonusSound
Sound played for a point bonus, if a certain level score is reached. Default is null.
-
onlyOnce
public boolean onlyOnce
Flag, if the level is only played once, even if the player does not win. Default is false.
-
hasReplay
public boolean hasReplay
Flag, if the level shows a replay after a cool play. Default is true.
-
dontKill
public boolean dontKill
Flag, if the level forbids killing other enemies. Default is false.
-
levelText
public java.lang.String levelText
Level text to show during level intro. Default is null.
-
showLevelProps
public boolean showLevelProps
Flag, if the level properties are shown before the level starts. Default is false.
-
flashAnimation
public int flashAnimation
Index of a flash animation before the level starts. Default is -1 for no animation.
-
teamMode
public boolean teamMode
Flag, if level is played in team mode. Default is false.
-
isSecret
public boolean isSecret
Flag, if level is a secret level. Default is false.
-
enemyInfos
public java.util.ArrayList<EnemyInfo> enemyInfos
List of enemy info.
-
randomItems
public java.util.ArrayList<ItemInfo> randomItems
List of random item info.
-
items
public java.util.ArrayList<ItemInfo> items
List of fixed item info.
-
fogs
public java.util.ArrayList<FogInfo> fogs
List of fixed fog info.
-
-
Method Detail
-
getField
public FieldInfo getField()
Gets the FieldInfo. If it is not explicitely defined, a field info containing only random points according to the Levels width and height is created.- Returns:
- the field info.
-
setField
public void setField(FieldInfo field)
Sets the field info.- Parameters:
field- the field to set
-
clone
public java.lang.Object clone()
- Overrides:
clonein classAbstractLevelInfo
-
getEnemyCount
public int getEnemyCount()
Gets the number of enemies in the level.- Returns:
- The number of enemies.
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value)Sets the property with the given key to the value.- Parameters:
key- The key.value- The value.
-
getProperty
public java.lang.Object getProperty(java.lang.String key)
Sets the property with the given key to the value.- Parameters:
key- The key.- Returns:
- The value.
-
getPropertyKeys
public java.util.List<java.lang.String> getPropertyKeys()
Gets a list of all property keys.- Returns:
- The list of all property keys.
-
getRandomColor
public int getRandomColor(boolean includeSwirling)
Gets a random color depending on the color probability definitions for this level..- Parameters:
includeSwirling- Flag, if swirling colors should be included in random colors- Returns:
- A color.
-
getName
public java.lang.String getName()
Returns the Level name.- Overrides:
getNamein classAbstractLevelInfo- Returns:
- The level name.
-
-