add example game
This commit is contained in:
parent
ad3bb3e386
commit
92f381be06
1 changed files with 19 additions and 0 deletions
19
README.md
19
README.md
|
|
@ -5,3 +5,22 @@
|
||||||
``` bash
|
``` bash
|
||||||
pip install git+https://github.com/WaylonWalker/pygame-starter
|
pip install git+https://github.com/WaylonWalker/pygame-starter
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Example Game
|
||||||
|
|
||||||
|
You can make a quick game by inheriting from Game, and calling
|
||||||
|
`.run()`. This example just fills the screen with an aqua color, but
|
||||||
|
you can put all of your game logic in the `game` method.
|
||||||
|
|
||||||
|
``` python
|
||||||
|
from pygame_starer import Game
|
||||||
|
|
||||||
|
class MyGame(Game):
|
||||||
|
def game(self):
|
||||||
|
self.screen.fill((128, 255, 255))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
game = MyGame()
|
||||||
|
game.run()
|
||||||
|
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue