From cdadd9af369e0c92eecd34fd002c59739a8769c4 Mon Sep 17 00:00:00 2001 From: themixray <35273590+themixray@users.noreply.github.com> Date: Tue, 2 Nov 2021 13:54:45 +0300 Subject: [PATCH] Update README.md --- README.md | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) diff --git a/README.md b/README.md index 2cb2d59..ed7be3a 100644 --- a/README.md +++ b/README.md @@ -2,57 +2,3 @@ A library for creating Python applications. [Documentation](https://github.com/themixray/pygwin/wiki) -*** -## Quick Start -A simple game. -```python -import pygwin -import random - -win = pygwin.create('A Simple Game', (500,500)) - -player = [250,250] -apple = pygwin.rect(random.randint(0,490), - random.randint(0,490),20,20) -count = 0 - -run = True -while run: - for event in pygwin.getEvents(): - if event.type == pygwin.QUIT: - run = False - win.fill((255,255,255)) - - playerRect = pygwin.rect(player[0]-10,player[1]-10,20,20) - win.draw.rect((0,0,0),playerRect) - win.draw.rect((200,50,50),apple) - - win.blit(count,(0,0)) - - if pygwin.keyboard.isPressed('w'): - player[1] -= 5 - if pygwin.keyboard.isPressed('s'): - player[1] += 5 - if pygwin.keyboard.isPressed('d'): - player[0] += 5 - if pygwin.keyboard.isPressed('a'): - player[0] -= 5 - - if player[0] <= -10: - player[0] = 510 - if player[1] <= -10: - player[1] = 510 - if player[0] > 510: - player[0] = -10 - if player[1] > 510: - player[1] = -10 - - if playerRect.collide(apple): - apple = pygwin.rect(random.randint(0,490), - random.randint(0,490),20,20) - count += 1 - - win.update(60) -pygwin.close() - -```