Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/klihe/asteroids-pygame
A simple game of shooting asteroids with a rocket and getting a points
https://github.com/klihe/asteroids-pygame
asteroids game pygame python rocket
Last synced: about 2 months ago
JSON representation
A simple game of shooting asteroids with a rocket and getting a points
- Host: GitHub
- URL: https://github.com/klihe/asteroids-pygame
- Owner: Klihe
- Created: 2024-01-05T13:53:46.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-06-22T13:51:22.000Z (6 months ago)
- Last Synced: 2024-10-31T23:06:39.895Z (about 2 months ago)
- Topics: asteroids, game, pygame, python, rocket
- Language: Python
- Homepage:
- Size: 83 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Asteroids-PyGame
A simple game of shooting asteroids with a rocket and getting a points
## Requirements
- [pygame](https://www.pygame.org/wiki/GettingStarted)
## Run
### MacOS/Linux
```bash
python3 main.py
```### Windows
```bash
python main.py
```## Controls
ESC - escape game
w - up
d - down
a - right
s - leftspace - fire
r - reload## States of game
- MENU - until you click on start button
- PLAYING - until you die
- GAME OVER - show best local score## Objects
### Player
```python
self.angle = 0self.score = 0
# hit asteroids with your body
self.body_damage = 15self.health = 100
self.rotation_speed_current = 0
self.movement_speed_current = 2.5
self.movement_speed_max = 10
```### Projectile
```python
# get angle from rocket
self.angle = angleself.movement_speed = 25 + speed
self.damage = 15
```### Asteroids
```python
if self.size == "small":
self.health = 15
self.damage = 10
self.score = 5
elif self.size == "medium":
self.health = 30
self.damage = 15
self.score = 10
elif self.size == "large":
self.health = 45
self.damage = 20
self.score = 15
```