From acd986a4018fe0ac6ecefcd9ef593a365093031e Mon Sep 17 00:00:00 2001 From: Ankit Kumar Prasad <72152415+ankit351@users.noreply.github.com> Date: Wed, 19 Oct 2022 19:21:08 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee2f0b8..7f4825b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,50 @@ # Hacktober2022 -Add DSA and basic programming codes #Hacktoberfest + #Hacktoberfest +# 1 - Import library + +import pygame + +from pygame.locals import * + +# 2 - Initialize the game + +pygame.init() + +width, height = 640, 480 + +screen=pygame.display.set_mode((width, height)) + +# 3 - Load images + +player = pygame.image.load("resources/images/dude.png") + +# 4 - keep looping through + +while 1: + + # 5 - clear the screen before drawing it again + + screen.fill(0) + + # 6 - draw the screen elements + + screen.blit(player, (100,100)) + + # 7 - update the screen + + pygame.display.flip() + + # 8 - loop through the events + + for event in pygame.event.get(): + + # check if the event is the X button + + if event.type==pygame.QUIT: + + # if it is quit the game + + pygame.quit() + + exit(0) + From f81d4be5349a9f67fa47f6a990afbec662665faf Mon Sep 17 00:00:00 2001 From: Ankit Kumar Prasad <72152415+ankit351@users.noreply.github.com> Date: Wed, 19 Oct 2022 19:23:59 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f4825b..f1d7222 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Hacktober2022 - #Hacktoberfest + + # 1 - Import library import pygame