-
Notifications
You must be signed in to change notification settings - Fork 43
Stadium (.hbs) File
A HaxBall stadium file is a text file with json5 format which contains a single StadiumObject.
StadiumObjects are the root object of a stadium file.
The name of the stadium.
The width of a rectangle centered in coordinates <0,0> in which the camera will be contained. The camera follows the player and ball until it reaches the bounds of this rectanngle.
The height of a rectangle centered in coordinates <0,0> in which the camera will be contained. The camera follows the player and ball until it reaches the bounds of this rectanngle.
The maximum allowed width viewable width for the level. If the player screen were wide enough for him to see more width than maxViewWidth then the the game will zoom in to prevent that.
Setting maxViewWidth to 0 disables this feature.
Default value: 0
Changes the camera following behaviour.
If set to "player" the camera will follow the player only, ignoring the ball.
If set to "ball" the camera will follow the average position between the player and the ball, the camera will prioritize the player in case player and ball are too far apart.
Default value: "ball"
The distance from <0,0> at which the teams will spawn during kickoff.
This value defines whether this stadium can be stored with the /store command.
Default value: true
An object describing the background for the stadium.
A map of traits. See TraitsObject documentation for an explanation of usage.
List of vertexes.
List of segments.
List of goals.
List of discs.
List of planes.
Object describing the player physics.
If omitted player default player physics will be used.
Disc used to create the ball.
If omitted default ball physics will be used.
The type of background to use for the stadium. Possible values are "grass", "hockey", and "none".
Default value: "none"
Width of the background rectangle.
Default value: 0
Height of the background rectangle.
Default value : 0
Radius of the kickoff circle.
Default value: 0
Radius of the corners of the circle (creates rounded corners if > 0)
Default value: 0
Horizontal distance to the goals from position <0,0>, used by "hockey" background only.
Default value: 0
Background color for the stadium.
Default value: "718C5A"
A vertex is a point which can collide with discs but cannot move and is not visible.
The x position for the vertex.
The y position for the vertex.
The bouncing coefficient.
A list of flags that represent this object's collision mask.
Read more about collision flags here.
A list of flags that represent this object's collision group.
Read more about collision flags here.
A segment is a line (curved or straight) that connects two vertexes. Discs can collide with segments and they can also be used as decoration.
Index of a vertex in the stadium vertex list to be used as first point of the segment.
Index of a vertex in the stadium vertex list to be used as the second point of the segment.
The bouncing coefficient.
The angle in degrees with which the segment will curve forming an arc between it's two vertexes.
Default value is 0 which makes the segment a straight line.
Alternative representation of the segment's curve. If this value is present the curve
value will be ignored.
This value is only useful for exporting stadiums without precision loss, it is recommended to remove curveF
and use only curve
when editing an exported stadium.
If set to 0 the segment will collide normally on both sides.
If greater or lower than 0 the bias determines the thickness of the segment. The segment also becomes a one-way segment that collides only in one of it's sides.
This property can be useful to create boundaries that small and fast moving balls are unable to pass through.
Default value: 0
A list of flags that represent this object's collision mask.
Read more about collision flags here.
A list of flags that represent this object's collision group.
Read more about collision flags here.
If set to false the segment will be invisible.
Default value: true
The color with which the segment will be drawn.
Default value: "000000" (black)
Goals are lines belonging to a team, when the ball crosses this line the opossite team scores a goal.
The coordinates of the fist point of the line in an array form [x, y].
The coordinates of the second point of the line in an array form [x, y].
The team the goal belongs to. Possible values: "red" or "blue"
Planes are collision objects that divide the map in two by an infinite line. They are useful for creating the boundaries of the stadium.
The direction vector of the plane in an array form [x, y].
The distance from coordinates [0,0] (in direction of the normal) in which the plane is located at.
The bouncing coefficient.
A list of flags that represent this object's collision mask.
Read more about collision flags here.
A list of flags that represent this object's collision group.
Read more about collision flags here.
Discs are circular physical objects that are placed in the stadium, they can move and collide with other discs.
The starting position of the object in array form [x, y].
The starting speed of the object in array form [x, y].
The radius of the disc.
The inverse of the disc's mass.
The damping factor of the disc.
The disc fill color.
Default value: "FFFFFF"
The bouncing coefficient.
A list of flags that represent this object's collision mask.
Read more about collision flags here.
A list of flags that represent this object's collision group.
Read more about collision flags here.
Player physics describes physical constants affecting the players.
See Disc.bCoef
See Disc.invMAss
See Disc.damping
How fast a player accelerates when moving around with his keys.
Replaces acceleration when the player is holding the kick button.
Replaces damping when the player is holding the kick button.
How much force the player applies to the a ball when kicking.