https://github.com/kartmaan/bouncing_cube
Cube bouncing against window edges and against a changing obstacle
https://github.com/kartmaan/bouncing_cube
animation bounce bounce-animations bugcollisiondetection collision collision-detection color cube obstacle-detection proportions pygame vectors
Last synced: about 1 year ago
JSON representation
Cube bouncing against window edges and against a changing obstacle
- Host: GitHub
- URL: https://github.com/kartmaan/bouncing_cube
- Owner: Kartmaan
- License: mit
- Created: 2020-10-28T16:35:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-29T14:12:16.000Z (about 3 years ago)
- Last Synced: 2025-01-24T07:29:59.699Z (over 1 year ago)
- Topics: animation, bounce, bounce-animations, bugcollisiondetection, collision, collision-detection, color, cube, obstacle-detection, proportions, pygame, vectors
- Language: Python
- Homepage:
- Size: 316 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bouncing_cube 1.6.1
## What does the program do ?
- A cube bounces against the edges of the window and against a central obstacle which contracts little by little
- The cube changes color depending on the location of its collision (upper/lower edges of the window, side edges of the window, over/under the central obstacle, etc.)
- Each time the cube comes in contact with an edge of the window, the width of the central obstacle contracts a notch. The obstacle continues to contract to a minimum before it returns to its original size
- The initial color of the obstacle changes color as it contracts
- The animation speed can be controlled by pressing up arrow (speed ++) or pressing down arrow (speed --), the initial speed can be retrieved by pressing space
- Real-time information can be displayed at the top left of the window (cube coordinates, obstacle width, vector etc. (Set `infoDisplay` to True)
## Screenshots
### Animation mosaic

### Infos display

## Requirements :
- `pygame`