I made a football simulation/game entirely using Python Turtle Graphics
# Overview:

About a year ago i made a project called as "Python Football Game" which was just a Pong game on green background and goal posts it felt like cheating so this time i made an entire football game with 11 players and other rules etc in python turtle with about *629 lines of code* you can have a look at it here:

&amp;#x200B;

[Working Of Simulation\/Game](https://reddit.com/link/u75ydj/video/awyg0ye3thu81/player)

[Python Football Simulation In Turtle](https://www.youtube.com/watch?v=7rRYpX5-9RI) (Alternative Link Youtube)

You can do all sorts of things from passing ball to other teammates to scoring goals to switching players (inspired by fifa like mechanics) with throwing ball to a teammate if it goes outside etc. The team that scores 3 goals first wins you play against CPU with enemy having its own Logical AI it's a fun experience.

# Source Code:

[Project Source Code Here](https://github.com/JackhammerYT/Football-Simulation)

# Controls:

w(up) ,  a(left) ,  d(right) , s(down) ,  q(north west) ,  e(north east) ,  z(south west) ,  x(south east) Space Bar (Change Player) ,  Mouse Click (Pass the ball onto clicked position)

# Challenges:

Even though with how simple it's design was there were few challenges i learned to overcome, the biggest one being Calling a function after a delay without using threads. This was a rather hard challenge to overcome because turtle is not a thread safe framework that is all the GUI operations need to run on main thread and it so happened that i required to call a GUI operation with delay i solved it by making my own FunctionInvoker class based on time module that invokes a function after a delay you can see it's structure in "[FunctionInvoker.py](https://FunctionInvoker.py)" file on github repo