-
Notifications
You must be signed in to change notification settings - Fork 0
Players
Players on the field can perform a single action each turn, which can lead to them earning points.
Players have several important properties that can change between turns.
- Location - the player's location on the field
- Height - the height of the top of the player's head, relative to the ground plane of the field
- Heading - the direction that a player is facing
- Inventory - what the player is holding
- Energy - How much energy the player has
For the purpose of collisions, players can be thought of as cylinders on the field. The bottom plane is at a height of zero, corresponding with the ground plane of the field. The top plane is at the player's height, which is the top of the player's head. The radius of the cylinder (for all players) is 50.0
. The central axis of the cylinder is the player's "location," relative to the bottom-left corner of the field when viewed from above.
If this cylinder collides with another player's cylinder, it will create a collision object between them, giving both of them damage and costing them some points. If this cylinder collides with a food "disk," it means that the food has collided with the player, and the player will take damage and lose points. If the cylinder collides with a wall or table, the player will be prevented from moving in that direction.
FoodFight is a turn-based game with 2000 turns. On each turn, each player can play one of eleven actions, or they can choose to play no action at all. Following is a list of all actions that a player can take.
A player moves in the direction of their heading. Their heading does not change. The distance traveled is 10 ± 1 pixels. If their movement causes them to collide with a wall or table, the distance moved will be limited to what they can move without intersecting with the wall or table. If a player is already against (and facing) a wall or table, they are unable to move forward.
Like moving forward, but in the reverse direction, and a distance of 5 ± 1 pixels.
A player turns counter-clockwise an angle of 0.05 ± 0.01 rad. This action is always valid.
Like turning left, but in the clockwise direction.
The player's height decreases by 5 ± 1 pixels, down to a minimum of 100 pixels. This may allow food to pass over the player when thrown from short range. Note that if a player performs any action other than a duck, their height will be restored to the default 200 pixels. This is always a valid action.
The player picks up a food piece with their left hand, adding it to the left slot of the player's inventory. The left slot of the player's inventory must be empty. If the desired food is on the ground, its location must be within 100 pixels of the player's location, and its direction from the player must be within π/3 radians of the player's left arm, which is π/6 radians counter-clockwise from the player's heading. In other words, if the player's location is l and their heading is θ it must be within a sextant centered at l, with a radius of 100 pixels and an arc that extends from θ - π/6 to θ + π/2. If there are multiple food pieces within this range, one is chosen at random. If there are no food pieces within this range, but the player is against a table (and facing the table), then the player will remove a random piece of food from the table.
Like picking up with the left hand, but the angles are flipped to the player's right side.
Throws a food piece from the left slot of the player's inventory. The food piece is added to the field at a distance of 100 pixels from the player's center location in the direction of the player's left hand. The height of the newly-created food piece is 150 ± 10 pixels. This action is only valid if the player's left inventory slot is non-empty.
Like throwing from the left hand, but draws from the right hand and throws in the direction of the player's right hand.
Removes a food piece from the left slot of the player's inventory. The energy value of the food is added to the player's energy. This action is only valid if the player's left inventory slot is non-empty.
Like eating from the left hand, but draws from the right hand instead.
A player's energy level determines how quickly they can move on the field. Energy is measured on a scale from 0 to 100, and all players start at 100 energy. A player loses energy every time they are hit by a piece of food (equal to the damage value of the food piece). Players also lose less energy (2 ± 1) each time they collide with another player, and they lose a much smaller amount (0.02) each turn that they perform an "active" action (anything other than ducking or eating). The only way for players to regain energy is by eating food.