Skip to content

Making a soccer game using periodic multithreading

Notifications You must be signed in to change notification settings

git-davi/botkeeper

Repository files navigation

botKeeper

Project for the course "Real-Time Embedded Systems", (master degree in Computer Engineering, UniMoRe). The purpose is to create a game that handle events and tasks with a periodic scheduling.

Dependencies

To play this game you will need :

  • g++ compiler
  • Allegro 4 graphic gaming library
  • PTask a Periodic Real-Time Task interface facility to pthreads

Note : While cloning this repo you will also get the ptask library, so don't worry on installing it!

How to install Allegro and ptask

From Linux terminal :

$ sudo apt-get install liballegro4-dev

How to play

First of all you need to compile the game :

$ make clean
$ make game

Then launch the game :

$ ./game

Now the game should start. Press space to stop direction and one more time to choose power. Esc to quit the game.

Enjoy

Architecture

This is the architecture of our project. It displays the interactions between the tasks and the resource. τ stands for task (yellow circle), and S stand for state, or resource, (green rectangle).

  • τ_palla -> task that update the position and the speed of the ball.
  • τ_port -> task for the goalkeeper, it updates his position based on the ball position, we also implemented a sort of prediction for better block.
  • τ_frec -> updates the rotation of the arrow that stores the shot direction.
  • τ_pow -> updates the indicator of the power bar on the lower left corner.
  • τ_user -> waits for the ball to stop. Then the user can press space two times and the task will store the of S_frec and S_pow in the ball state.
  • τ_grafico -> The task that periodically reads the info of each state and draws on screen.

Troubleshooting

If you meet some errors during compilation try :

$ sudo apt-get install g++

About

Making a soccer game using periodic multithreading

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published