Pygame is a cross-platform set of Python modules designed for writing video games. It includes computer graphics and sound libraries designed to be used with the Python programming language. Now, it’s up to the imagination or necessity of developer, what type of game he/she wants to develop using this toolkit.
So, in this article, we will learn how to make an object jump using PyGame library in Python.
There is basic formula from classical mechanics to make an object jump.
F = 1/2 * m * v^2
Where F is the force up/down, m is the mass of the object and v is the velocity. The velocity goes down over time because when the object jumps the velocity will not increase more in this simulation. When object reaches the ground, the jump ends. If
isjump variable is True or False it indicates object is jumping or not. If
isjump is True, object position will be updated according to the above formula.
- Python - Moving an object in PyGame
- Making a text object with VPython
- Tic Tac Toe GUI In Python using PyGame
- Python | Display images with PyGame
- Python | Display text to PyGame window
- Python | Drawing different shapes on PyGame window
- Python | Playing audio file in Pygame
- Python - Drawing design using arrow keys in PyGame
- Object Oriented Programming in Python | Set 2 (Data Hiding and Object Printing)
- Object Oriented Programming in Python | Set 1 (Class, Object and Members)
- Python | Making program run faster
- Python - Making a Reddit bot with PRAW
- Introduction to pygame
- 8-bit game using pygame
- How to create Buttons in a game using PyGame?
- How to initialize all the imported modules in PyGame?
- Bubble sort visualizer using PyGame
- How to add color breezing effect using pygame?
- Click Module in Python | Making awesome Command Line Utilities
- Python - Read blob object in python using wand library
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 Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.