Player12
An open source football management simulator
Loading...
Searching...
No Matches
MatchPlayerInput Struct Reference

#include <match_engine.h>

Public Attributes

float moveX = 0.0f
 
float moveY = 0.0f
 
bool sprint = false
 
MatchInputAction action = MatchInputAction::NONE
 
float aimX = 0.0f
 
float aimY = 0.0f
 
float power = 0.0f
 
bool jockey = false
 
std::uint8_t passAssist = 1
 

Detailed Description

Controller state for the externally controlled player, e.g. a human's pad in play mode. Directions are in pitch metres (x along the length toward x=105, y across toward y=68); only the direction and a magnitude up to 1 matter.

Shots and passes go through the same execution model as the AI's (the player's technique, pressure, distance and fatigue decide the error), so the stick only chooses where the player tries to play the ball.

Member Data Documentation

◆ action

MatchInputAction MatchPlayerInput::action = MatchInputAction::NONE

Action button, performed at the first step it is possible (carrying the ball for passes, shots and clearances; near the opposing carrier for tackles) or dropped after MatchTuning::Control::ACTION_BUFFER_SECONDS. It fires on the press: holding the same action in later inputs does not repeat it; release (NONE) or a different action re-arms.

◆ aimX

float MatchPlayerInput::aimX = 0.0f

Pass aim direction; zero aims along the stick (or the facing).

◆ aimY

float MatchPlayerInput::aimY = 0.0f

◆ jockey

bool MatchPlayerInput::jockey = false

Jockey (held): the player stays on his feet facing the ball at a contain pace; with the stick idle he holds a goal-side line on the carrier.

◆ moveX

float MatchPlayerInput::moveX = 0.0f

Stick: run direction, magnitude 0..1 of the run speed (0 = stand).

◆ moveY

float MatchPlayerInput::moveY = 0.0f

◆ passAssist

std::uint8_t MatchPlayerInput::passAssist = 1

Pass assistance: 0 plays the pass along the stick, 1 (default) leans toward the best placed team-mate near the aim, 2 picks him in a wide cone.

◆ power

float MatchPlayerInput::power = 0.0f

Strength of the action in [0, 1] from how long its button was held: the shot's pace (a full bar also lifts and widens it), or how far ahead a through ball or a pass into space is played. 0 lets the player choose.

◆ sprint

bool MatchPlayerInput::sprint = false

Sprint button: run at top speed instead of the jog share.


The documentation for this struct was generated from the following file: