shihabmuhtasim / 2D-Games-using-OpenGL-in-Python

This repository contains multiple games of OpenGL that are built in Python focusing on user engagement and graphical representation and midpoint line, circle algorithms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2D-Games-using-OpenGL-in-Python

This repository contains multiple games of OpenGL that are built in Python, showcasing various graphical and interactive elements through OpenGL primitives and Python programming. Each game is designed to provide a unique interactive experience, focusing on user engagement and graphical representation.

GitHub top language GitHub language count GitHub last commit GitHub repo file count GitHub repo size GitHub watchers

14

Space Shooter:

Space Shooter is an intense 2D game where multiple obstacles fall, and the player must navigate and destroy them using a spaceship. The spaceship can fire bullets diagonally or straight up, controlled by the keyboard arrows, and moved using the mouse. After destroying obstacles, gain special powers to create a circular ball for additional points. Manage your health with three hearts and aim for a high score before the game ends. Play, pause, restart, or close the game using on-screen buttons.

  • Mouse Functionality: Move the spaceship using the mouse.
  • Keyboard Arrows: Fire bullets diagonally or straight up.
  • Special Power: Click to create a circular ball after destroying 5 obstacles.
  • Difficulty: Increases with more and faster obstacles.
  • Lives: 3 hearts representing health.

Diamond Catcher:

Catch falling diamonds before they hit the ground in this engaging 2D game. Use left and right arrow keys to move the catcher bowl horizontally. Each successfully caught diamond increases your score, while missed diamonds end the game. Experience an increase in falling speed over time, challenging your reflexes and timing.

  • Keyboard Control: Move the catcher using left and right arrow keys.
  • Game Over: Missing a diamond ends the game and freezes the catcher.
  • Scoring: Catch diamonds for points, visible on the console.
  • Visuals: Randomly colored diamonds falling from random positions.

Water Drops:

Simulate a serene water body with interactive water drops. Right-clicking generates growing circles, representing ripples or water drops. Control the growth speed of these circles with keyboard arrows, creating a dynamic and engaging water simulation.

  • Mouse Functionality: Right-click to generate water drops.
  • Growth Control: Use UP and DOWN arrows to control growth speed.
  • Pause/Resume: Spacebar to pause and resume the simulation.
  • Visibility: Circles grow until they exceed the screen boundary.

House Rain:

Create a cozy scene of a house in the rain, where you can control the rain's direction and the scene's ambiance. Use arrow keys to bend the rain and simulate day and night changes. This game combines visual appeal with interactive elements to simulate an ever-changing weather pattern around a simple house structure.

  • Rain Direction: Left and right arrows to bend the rain.
  • Ambiance Control: Assign keys to shift between day and night.
  • Visuals: Basic house structure using GL primitives.

Moving Balls:

An interactive box where random points are generated upon right-clicks, moving in various directions. Control the speed, pause the action, and enjoy the visual feast of blinking points. A game that's simple in concept but offers a rich interactive experience through basic graphical elements.

  • Point Generation: Right-click to generate movable points.
  • Speed Control: UP and DOWN arrows to control the speed.
  • Blinking Effect: Left-click for points to blink.
  • Pause/Resume: Spacebar to freeze or unfreeze points.

Each game in this repository aims to demonstrate the power of graphical programming in Python using OpenGL, focusing on interaction, physics, and visual aesthetics. Only midpoint line, circle algorithms, and point draw function were used to draw the objects in most of the games to enhance deep learning of the functionalities. Dive into the code to learn more about implementing these interactive elements and enjoy enhancing or playing them!

About

This repository contains multiple games of OpenGL that are built in Python focusing on user engagement and graphical representation and midpoint line, circle algorithms.


Languages

Language:Python 100.0%