## Naprogramovanie hry v priamom prenose v jazyku Python
## Space Invaders ## in 60 minutes miroslav.binas@tuke.sk / [**Y-Games 2019**](https://yzone.sk/ygames-2019)
## Hráte sa počítačové hry?
## Naprogramovali ste si vlastnú počítačovú hru?
![Space Invaders](images/banner-space.invaders.jpg) Note: * https://arcademarquee.com/?product=space-invaders-arcade-marquee-26-x-8
[![Kenney.nl](images/kenney-promo.png)](https://kenney.nl/)
[![Pygame logo](images/logo-pygame.png)](https://www.pygame.org/news)
[![SDL logo](images/logo-sdl.png)](https://www.libsdl.org/) Since 1998
![Steam logo](images/logo-steam.jpg)
### Pygame Zero is for creating games without boilerplate.
Note: * https://www.raspberrypi.org/magpi/wp-content/uploads/2015/06/35_PygameZero.jpg
## Installation * Raspberry Pi - builtin * `sudo dnf install pgzero mu` * `pip install pgzero mu-editor`
## Warning! (no best practices provided)
![Game Loop](images/game-loop-simple.png) Note: * http://gameprogrammingpatterns.com/images/game-loop-simple.png
## Project Structure ``` . ├── invaders.py ├── sounds/ │ ├── beep.wav │ └── jingle.wav └── images/ ├── background.png ├── invader.png ├── laser.png └── player.png ```
![Actor](images/invader.png)
## Pygame Handles ![Pygame Handles](images/handles.png)
## Collisioin Detection
![Collisions](images/collisions.png) Note: * https://treadgaming.blogspot.com/2016/06/video-game-physics-tutorial-part-ii.html
## Questions?
## What's Next?
![qr code](https://api.qrserver.com/v1/create-qr-code/?data=http://bit.ly/2Hy2Jwn&size=300x300) (**http://bit.ly/2Hy2Jwn**)