Over the last few months I have been super busy and not really had much time to undergo any large coding projects outside of work. I therefore decided to undertake some fun projects that I could just tweak and add features in my spare time. I decided to make some games on Pygame as I haven’t had too much experience with building user interfaces before, and there is something I find very satisfying about being able to see a graphical representation of how my code is working.
Over the last few weeks I have building and adding features to a solar system simulator. (Code: https://github.com/domrigby/funPlanetSim.git). This was my first proper experience of building a (very bad) user interface. I found it quite enjoyable building all the classes I would need to draw items and get functionality, such as arrows, buttons and planets. This project was fun to make, but the final outcome was a lot less enjoyable to play with that it was to build. In the words of Terry Davis, “build games, don’t play them”.
Subbuteo
Whilst I have been back for Christmas, I wanted to build a game that was actually a bit more playable. My dad is a big Subbuteo fan so I decided to try and build my own version of the classic football game. The code for the project is here:
https://github.com/domrigby/Subuteo.git
Above is a bit of gameplay of v1 of the Subbuteo game. This was a fun little project as it included quite a lot of vector maths from my first year mechanics module.
UPDATE: Subbuteo 2.0!
After testing the game by playing against myself for a while, I decided to add a single player option. This meant adding a bot which could choose which shot to take and then take it. In its current form its pretty simple. The bot will calculate the position it must hit the ball in order for it to hit it and score. It will then choose which player to take the shot. It does this by calculating the angle between the ball, aim point and the player. Whichever is closest to being a straight line will take the shot.
Over the coming weeks I want to add some more features to the bot. It is however in a surprisingly competitive state. It will always go for goal no matter the scenario and therefore ends up making the correct decision about 50% of the time, making it quite competitive. In future I want to add wall shots and some opposition positioning based decision making.