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 int
backgroundColor
The background color.int
backgroundForeColor
The background forecolor.java.lang.String
backgroundImage
String for a background image.int
blackRainProb
Probability of black rain starting when entering black points.int[]
colorProb
Random colors probabilities.int[]
colors
Random colors.int
cyanProb
Probability in percent for new items, if a figure enters a cyan point. 18 per default.boolean
directFlash
Flag, if no flash fx to next level should be shown.boolean
dontKill
Flag, if the level forbids killing other enemies.java.util.ArrayList<EnemyInfo>
enemyInfos
List of enemy info.int
enemyIQ
The enemies iq.int
enemySpeed
The enemies speed.int
explosionEnergyLoss
The energy a figure will loose while standing on an exploding point per round.int
flashAnimation
Index of a flash animation before the level starts.java.lang.String[]
fogClasses
List of random item infos.int
fogdensity
The density of fogs in percent of points per field.int[]
fogProb
List of fog probabilities.java.util.ArrayList<FogInfo>
fogs
List of fixed fog info.int
grayEnergyLoss
The energy a figure will loose while standing on a gray point per round.boolean
hasReplay
Flag, if the level shows a replay after a cool play.java.lang.String
hasShop
Name of a shop is before of level.int
height
The height of the field.int
initialSwirlingRounds
Length of color swirling effect in rounds.boolean
isSecret
Flag, if level is a secret level.int
itemdensity
The density of items in percent of points per field.java.util.ArrayList<ItemInfo>
items
List of fixed item info.boolean
lastFigureWins
Flag, if the last living figure wins the level.int
levelColor
A color for the level introduction.java.lang.String
levelSound
Level sound.java.lang.String
levelText
Level text to show during level intro.boolean
looseLives
Flag, if dying in this level costs a live.int
magentaEnergyGain
The energy a figure will gain while standing on a magenta point per round.boolean
makeStartPointsGray
Flag, if the starting points are colored lightgray.java.lang.String
name
Level name.boolean
onlyOnce
Flag, if the level is only played once, even if the player does not win.boolean
onlyWinnerGetsPoints
Flag, if only the winner or every player gets its points added to its point sum.boolean
placeItems
Flag if random items are placed at the beginning of the level.int
pointBonusExtra
Bonus for a point bonus, if a certain level score is reached.int
pointBonusLimit
Limit for a point bonus, if a certain level score is reached.java.lang.String
pointBonusSound
Sound played for a point bonus, if a certain level score is reached.java.lang.String
pointBonusText
String for a point bonus, if a certain level score is reached.java.util.ArrayList<ItemInfo>
randomItems
List of random item info.int
redHeatGain
Heat gain on red points.int
roundLimit
The round limit for this level.boolean
showLevelProps
Flag, if the level properties are shown before the level starts.boolean
showRounds
Flag, if the round limit should be displayed on the screen.java.lang.String
soundPath
String for an optional subfolder for random sounds.boolean
teamMode
Flag, if level is played in team mode.int
width
The 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.Object
clone()
int
getEnemyCount()
Gets the number of enemies in the level.FieldInfo
getField()
Gets the FieldInfo.java.lang.String
getName()
Returns the Level name.java.lang.Object
getProperty(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.int
getRandomColor(boolean includeSwirling)
Gets a random color depending on the color probability definitions for this level..void
setField(FieldInfo field)
Sets the field info.void
setProperty(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:
clone
in 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:
getName
in classAbstractLevelInfo
- Returns:
- The level name.
-
-