This project is an example implementation of the footballsimulationengine node module available on npmjs.
- Download the project onto your system ({dir})
- cd {dir}
- run
npm install
- load your team into the {dir}/teams directory (you can use an existing team as an example)
- in '{dir}/server.js' change for team1 and team2:
readFile("teams/team1.json").then(function (team1) {
to your newly created .json file i.e.
readFile("teams/myTeam.json").then(function (team1) {
- Set the pitch size by changing the
pitchWidth
andpitchHeight
in '{dir}/teams/pitch.json' Note: Any changes will need changes made to the start positions of the players - run
npm start
- Go To
http://localhost:1442/match.html
- Press
Setup
- This starts a new match where the pitch size is displayed on the screen and the players are in their correct positions.
- Press
>
- This runs half the number of iterations defined in
public/js/match.js
var gamelength = 12000;
- Press pause
||
to pause the iteration - Press ``2nd Half`
- This flips the players to opposite sides
- Press
Show Logs
to toggle on or off logging i.e.Iteration 50: Closest Player to ball: Louise Johnson,Closest Player to ball: Aiden Smith
- See a match example here