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.
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.
![](https://private-user-images.githubusercontent.com/92597456/292650250-7a245296-37d4-4c17-ba36-ec2589c62ea0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjY1NzQsIm5iZiI6MTcyNDM2NjI3NCwicGF0aCI6Ii85MjU5NzQ1Ni8yOTI2NTAyNTAtN2EyNDUyOTYtMzdkNC00YzE3LWJhMzYtZWMyNTg5YzYyZWEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyMzc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZiODczYjE3ZmQ2MDdiOThiY2YwNjZiYmE1ZTI3YTU2ZjJlZTc0NzlkOWYwZGE3MzcwNmRhNDVhNTY0Yzk2ZDkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ZoS4z2JcdPaWRD6oO-MuDvXHIv6cqHNpYixt7MAPAzc)
![](https://private-user-images.githubusercontent.com/92597456/292650613-16f959b5-3359-4f98-92a7-0918f016a339.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjY1NzQsIm5iZiI6MTcyNDM2NjI3NCwicGF0aCI6Ii85MjU5NzQ1Ni8yOTI2NTA2MTMtMTZmOTU5YjUtMzM1OS00Zjk4LTkyYTctMDkxOGYwMTZhMzM5LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyMzc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE1NmVhNDE5YTdiZjg0Y2QxNTllNTUwMmE4NzRmNDhmMzU5ZjliMjdmNjJhNDM0NWU4NGU5ZTNlZGFjNmM4YjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gSBumhlPfteHC0u4NLUPaBKUt1GWRwQZYXLikLFkpDg)
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.
![](https://private-user-images.githubusercontent.com/92597456/292650044-39bccc05-11bc-4c53-90e9-81dede562d47.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjY1NzQsIm5iZiI6MTcyNDM2NjI3NCwicGF0aCI6Ii85MjU5NzQ1Ni8yOTI2NTAwNDQtMzliY2NjMDUtMTFiYy00YzUzLTkwZTktODFkZWRlNTYyZDQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyMzc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFkOTAxNmVjNDBiMGRhNGI2MmYyZjdiOGM1MzIyZWU2OTA4YjUxYjg5NTc4MWIwYjdiM2JjYjM4NThhMjc2MDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.zj4TFHyOTGh1JceRl_qTy3Zxxf-dZ5DqUBNFW_0u12k)
![](https://private-user-images.githubusercontent.com/92597456/292650627-a49ca168-7bd9-4893-9400-8dbcee61c6c5.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjY1NzQsIm5iZiI6MTcyNDM2NjI3NCwicGF0aCI6Ii85MjU5NzQ1Ni8yOTI2NTA2MjctYTQ5Y2ExNjgtN2JkOS00ODkzLTk0MDAtOGRiY2VlNjFjNmM1LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyMzc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ2OTE2NzY3OGMyOWU2MTdkNjgyYjJkYjYxYTc3N2Q4OTFlMmM4MmExODg1NjM2Yjg2ZjlkYzdkMjAzZGYwZDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.cKNOAC0QnN9Uckh_FyLjLBF-eSZP05q79ryocqKeab0)
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.
![](https://private-user-images.githubusercontent.com/92597456/292650149-3972ba3c-f9b8-4090-a875-c79f69c8dda4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjY1NzQsIm5iZiI6MTcyNDM2NjI3NCwicGF0aCI6Ii85MjU5NzQ1Ni8yOTI2NTAxNDktMzk3MmJhM2MtZjliOC00MDkwLWE4NzUtYzc5ZjY5YzhkZGE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLN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PTAmcmVwb19pZD0wIn0.3ChE9vijfPaRIaONWUdgSNnnS8IFQmdkZ2Fo26uHpm8)
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.
![](https://private-user-images.githubusercontent.com/92597456/292650117-ce7fab5f-8615-45d4-b4d2-61559f9804d3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjY1NzQsIm5iZiI6MTcyNDM2NjI3NCwicGF0aCI6Ii85MjU5NzQ1Ni8yOTI2NTAxMTctY2U3ZmFiNWYtODYxNS00NWQ0LWI0ZDItNjE1NTlmOTgwNGQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyMzc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhYjY0Y2Q0YzhhNGM3OGM1NzVjYWU4NTcyMjYyMmM5ODZjNzFlNGM0OTFkNTlhNGVlNjI4Nzg4ZjIwYTAzNzcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.QHdqfTaW67_DZjA55Rgn-RntZVZBhd7s8NaHHzb7kVY)
![](https://private-user-images.githubusercontent.com/92597456/292650625-355a9da6-752d-4dfc-b8b4-56dc7c9804d5.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzNjY1NzQsIm5iZiI6MTcyNDM2NjI3NCwicGF0aCI6Ii85MjU5NzQ1Ni8yOTI2NTA2MjUtMzU1YTlkYTYtNzUyZC00ZGZjLWI4YjQtNTZkYzdjOTgwNGQ1LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyMzc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM2ZjMyNGRiOGE1YTliNDQwMDU5ZjYxZjZkNjI0ZjliYmViMjg0MDE0NTdjZWYxNmQ3ZDJmZjU5MGE4YmM5ZDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bzT3PbLsZo8GwsEZxWLLPUz5WNJD9XRg1A4y2GP21Sw)
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.
![](https://private-user-images.githubusercontent.com/92597456/292650133-831f1817-5a37-4681-9b5a-16b09fa2b845.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50Lm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fcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIyVDIyMzc1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY1NDM5YmE3MWNmYWNiYzg5NzBmZTE3M2RlNWJkODBiZjNiMzdhNmIzYzk5NjNkY2U1YzE0NTJkMWM0NDk3YTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.wdPKBbET65hPU0s1dDnRztroBPQ8q1e5WmTPSmiHDqQ)
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!