Skip to content

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Catch the Diamonds!

OpenGL License

A 2D reflex-based game where you control a catcher bowl to grab falling diamonds before they hit the ground. Built using Python and OpenGL, and rendered completely with the Midpoint Line Drawing Algorithm and GL_POINTS.

Assignment 02 โ€” 2D Game Implementation
Course: CSE423 (Computer Graphics, 0.75 credit)
Lab Instructor: Farhan Feroz [FHZ] & Arian Nuhan [CARN]
Semester: Spring 2025


๐Ÿงฉ Game Description

You play as a catcher bowl at the bottom of the screen. Colored diamonds fall from the top, and your job is to catch them. If a diamond falls and hits the ground, it's game over. As time progresses, the diamonds fall faster, increasing the challenge!


๐ŸŽฎ Features

  • ๐ŸŸฃ Diamonds rendered using 8-way Midpoint Line Drawing
  • ๐ŸŽฏ Catcher bowl made with 4 midpoint lines (trapezoid shape)
  • ๐Ÿ–ฑ๏ธ Mouse-controlled UI with:
    • Restart Button (โ†ฉ๏ธ)
    • Play/Pause Button (โ–ถ๏ธ/โธ๏ธ)
    • Quit Button (โŒ)
  • ๐ŸŽจ Bright, randomly colored diamonds
  • ๐Ÿ•น๏ธ Responsive horizontal movement using arrow keys
  • โฑ๏ธ Speed increases over time using delta time
  • ๐Ÿ“ AABB-based collision detection

๐Ÿ•น๏ธ Controls

Input Action
โฌ…๏ธ / โžก๏ธ Move catcher left/right
Mouse Click Interact with buttons (โ†ฉ๏ธ โธ๏ธ โŒ)
Restart Btn Starts a new game
Play/Pause Btn Toggles falling/paused state
Quit Btn Ends the game

๐Ÿงฎ Technical Highlights

  • Implemented Midpoint Line Drawing Algorithm for all shapes.
  • Used zone conversion to support drawing lines in all 8 directions using a single method.
  • Applied Axis-Aligned Bounding Box (AABB) collision detection.
  • Used delta timing to ensure consistent motion across different frame rates.

๐Ÿ”ง Installation

Requirements

  • Python 3.x
  • PyOpenGL
  • PyOpenGL_accelerate

๐Ÿ“š Related Assignments


๐Ÿง‘โ€๐Ÿ’ป Author

Monowar Husain
๐Ÿ“ง monowar@monowar.me
๐Ÿ“ง monowarhusainomi@gmail.com
๐ŸŒ monowar.me

About

๐ŸŽฎ A 2D OpenGL game where you catch falling diamonds using a bowl-shaped catcher โ€” built using Python and Midpoint Line Drawing Algorithm for CSE423 Assignment 02.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages