Skip to content
/ planes Public

A personal take on the classic Planes game, built in Python with Pygame and featuring a custom-designed smart AI algorithm.

License

Notifications You must be signed in to change notification settings

dosqas/planes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

๐Ÿ›ฉ๏ธ Planes Game

๐ŸŽ‰ Introduction

Welcome to Planes! It is a strategy-based guessing game inspired by Battleship, but with a thrilling twist! Instead of sinking ships, your mission is to locate and shoot down three hidden planes on a 10ร—10 grid. The catch? A plane can only be destroyed by hitting its head/cockpit.

This game is very close to my heart since I used to play it on paper with my classmates back in elementary school, making guesses and sketching planes during breaks. My parents also played it when they were young and enjoyed it just as much. Recreating it as a full-fledged Python game was not only a fun challenge, but also a nostalgic trip back to those moments.

This project was developed in Python as my final homework for the Fundamentals of Programming course during my first year of university.

Main Menu
Smooth and simple navigation before the strategic battle begins!


๐Ÿง  AI Opponent

The game features an intelligent AI powered by a custom algorithm I designed, inspired by the probability density function used in smart Battleship AIs.

Unlike random guessing, this AI:

  • ๐Ÿ“Š Calculates the most probable locations of your planes.
  • ๐ŸŽฏ Adjusts its guesses based on previous hits and misses.
  • ๐Ÿ”„ Learns and improves efficiency during the match.

This makes it a challenging and adaptive opponent for players of all skill levels.


๐ŸŒŸ Features & Gameplay Highlights

  • ๐Ÿ—บ๏ธ Strategy Phase - Place your planes anywhere on the board and rotate them with the spacebar to outwit the AI.
    Strategy Phase

  • ๐ŸŽฏ Play Phase - Take turns with the smart AI to guess your opponentโ€™s plane locations. Hit the cockpit to destroy a plane!
    Play Phase

  • ๐Ÿง  Smart AI Opponent โ€“ Uses a probability-based targeting system instead of random guessing, making the challenge more engaging.

  • ๐ŸŽฎ Turn-Based Gameplay โ€“ Fair play with alternating turns between you and the AI.

  • ๐Ÿ“Š Dynamic Difficulty โ€“ The AI adapts based on your moves and accuracy, keeping the challenge balanced.


๐Ÿ† Challenges & Learnings

The most challenging part of developing this game was designing the smart AI. I researched how probability density functions are used in advanced Battleship AIs and then adapted those ideas to fit the unique rules of Planes. The result is my own original algorithm, custom-built for this game.

Through this process, I:

  • ๐Ÿ” Learned how to analyze and adapt an existing algorithm to a new problem.
  • ๐Ÿ’ก Practiced breaking down complex logic into smaller, testable components.
  • ๐Ÿ Improved my Python development skills, especially in structuring a project and handling game states.
  • ๐ŸŽฏ Gained experience in balancing AI difficulty to make it fun yet competitive.

This was both a technical challenge and a great learning experience.


โš™๏ธ Requirements

  • Python 3.x
  • pip for installing dependencies

๐Ÿš€ Installation

  1. Clone the repository:

    git clone https://github.com/dosqas/planes.git
    cd planes
  2. Check your Python version:

    python --version
  3. Install dependencies:

    pip install -r requirements.txt

โ–ถ๏ธ Running the Game

python -m src.main

Acknowledgements

  • Thanks to the creators of the images used in this game.
  • Special thanks to the Pygame community for the fantastic library that made game development enjoyable and accessible.

๐Ÿ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


๐Ÿ’ก Contact

Questions, feedback, or ideas? Reach out anytime at sebastian.soptelea@proton.me.

About

A personal take on the classic Planes game, built in Python with Pygame and featuring a custom-designed smart AI algorithm.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages