BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//American Young Coder - ECPv6.10.1.1//NONSGML v1.0//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:American Young Coder
X-ORIGINAL-URL:https://www.ayclogic.com
X-WR-CALDESC:Events for American Young Coder
REFRESH-INTERVAL;VALUE=DURATION:PT1H
X-Robots-Tag:noindex
X-PUBLISHED-TTL:PT1H
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:DAYLIGHT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
TZNAME:PDT
DTSTART:20230312T100000
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
TZNAME:PST
DTSTART:20231105T090000
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=America/Los_Angeles:20230717T190000
DTEND;TZID=America/Los_Angeles:20230717T200000
DTSTAMP:20260430T101548
CREATED:20230718T030424Z
LAST-MODIFIED:20230718T030535Z
UID:20645-1689620400-1689624000@www.ayclogic.com
SUMMARY:7 PM – Python Game Development – Sebastian
DESCRIPTION:Today We Did\n\nReviewed how to use Gitlab & went over homework\nLearned how to change the size of an image by scaling\nLearned how to change the position of an image with attributes\nIn case you need anything\, feel free to email me at sebastian@ayclogic.com\n\nHomework\n\nRemember to create good commit messages when you push your homework by next Sunday.\nHomework:a) The same way we created our birds 1-3\, make a fourth bird using the fourth bird image\nb) For this bird\, give it a variable x and y but this time it should start on the bottom right of the screen \nc) Change the x and y attributes for our new bird4 so that it flies from the bottom right to the top left\n\nCode from class: \nimport pygame \nclass Birdie():\nWIDTH = 1000\nHEIGHT = 750 \nFPS = 40\ndef __init__(self):\npygame.init() \nself.screen = pygame.display.set_mode((Birdie.WIDTH\, Birdie.HEIGHT))\nself.project_name = “Birdie” \npygame.display.set_caption(self.project_name) \n# Loop until the user clicks the close button.\nself.running = True \n# Used to manage how fast the screen updates\nself.clock = pygame.time.Clock() \nself.background_image = pygame.image.load(“assets/background_img.png”) \nself.bird1 = pygame.image.load(“assets/bird01_A.png”)\nself.bird1 = pygame.transform.scale(self.bird1\, (70\, 50)) \nself.bird2 = pygame.image.load(“assets/bird02_A.png”)\nself.bird2 = pygame.transform.scale(self.bird2\, (140\, 100)) \nself.bird3 = pygame.image.load(“assets/bird03_A.png”)\nself.bird3 = pygame.transform.scale(self.bird3\, (70\, 40)) \nself.bird1_x = 50\nself.bird1_y = 50\nself.bird2_y = 200\nself.bird3_x = 500 \ndef game_loop(self):\n# ——– Main Program Loop ———–\nwhile self.running:\n# — Main event loop\nfor event in pygame.event.get():\nif event.type == pygame.QUIT:\nself.running = False \npygame.display.flip() \nself.screen.blit(self.background_image\, (0\, 0)) \nself.screen.blit(self.bird1\, (self.bird1_x\, self.bird1_y))\nself.screen.blit(self.bird2\, (100\, self.bird2_y))\nself.screen.blit(self.bird3\, (self.bird3_x\, 450)) \nself.bird1_x += 1\nself.bird1_y += 1\nself.bird2_y += 1\nself.bird3_x += 5 \nself.clock.tick(Birdie.FPS)\ncurrent_fps = str(self.clock.get_fps())\npygame.display.set_caption(f'{self.project_name}\, fps: {current_fps}’) \n# Close the window and quit.\npygame.quit() \nif __name__ == ‘__main__’:\nsb = Birdie()\nsb.game_loop()
URL:https://www.ayclogic.com/event/7-pm-python-game-development-sebastian/
CATEGORIES:Python Class,Python Game Development
END:VEVENT
END:VCALENDAR