Prerequisite – OpenGL
OpenGL is a cross-language, cross-platform API for rendering 2D and 3D Vector Graphics. Using this, we can make a lot of design as well as animations. Below is a simple Game made using OpenGL.
Description : In this, a ball is moving starting from middle and goes to up-left in starting. But, then it collides with wall and changes direction but speed remain same. Consequently, it comes to downward direction where it should be catched on a rectangle (which is capable of moving in horizontal direction) in order to continue.
For working on Ubuntu operating system:
gcc filename.c -lGL -lGLU -lglut -lm where filename.c is the name of the file with which this program is saved.
Below is the screenshot of the animation. This screenshot is of one instance. In actual, ball will move in different direction which should be catched on the smaller rectangle. Rectangle can be moved to left by pressing lowercase b and towards right by lowercase n. However, this can be changed by changing the code in keyboard function where ASCII value of key can be changed.
This article is contributed by Aditya Kumar. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- OpenGL program for simple Animation (Revolution) in C
- Python | Catching the ball game
- Scan-line Polygon filling using OPENGL in C
- Creating animations using Transformations in OpenGL
- Basic Transformations in OPENGL
- Rendering a Triangle using OpenGL(using Shaders)
- OpenGL Rendering Pipeline | An Overview
- Getting started with OpenGL
- scanf() and fscanf() in C - Simple Yet Poweful
- Simple Chat Room using Python
- Python | Simple registration form using Tkinter
- Python | Simple GUI calculator using Tkinter
- Java Swing | Simple User Registration Form
- A Number Link Game
- Implementation of Minesweeper Game
- Hangman Game in Python
- Project Idea | Breakout game in Python
- Guess Game using rand() and srand() in C
- Color game using Tkinter in Python
- Number Guessing Game in Python using Binary Search