
Download Python and Pygame 3.4: https://www.python.org/downloads/ http://www.pygame.org/download.shtml Here's the code incase you're lazy: import pygame, sys black = (0,0,0) white = (255,255,255) pygame.init() screen = pygame.display.set_mode((400,400)) pygame.display.set_caption('YouTube') clock = pygame.time.Clock() def key(key): return pygame.key.get_pressed()[eval("pygame.K_"+key)] box = pygame.Rect(100,100,200,200) speed = 8 while True: if pygame.event.get(pygame.QUIT): pygame.quit(); sys.exit() screen.fill(white) pygame.draw.rect(screen, black, box) pygame.display.flip() clock.tick(60) if key("UP"): box.y-=speed if key("DOWN"): box.y+=speed if key("LEFT"): box.x-=speed if key("RIGHT"): box.x+=speed Hope you enjoy ^_^
Python / Pygame - Tutorial Part 2 (For beginners) - YouTube |
| 25 Likes | 25 Dislikes |
| 2,013 views views | 1,842 followers |
| Gaming | Upload TimePublished on 25 Jan 2015 |
\u200fyoutube,\u200ffortnite,\u200fgoogle translate,\u200f\u202bgoogle\u202c,\u200fminecraft,\u200fok google,\u200fpubg,\u200fsiri,\u200fجمعة مباركة,\u200fصباح الخير,\u200fطيور الجنة,\u200fسورة البقرة,\u200fقران,\u200fسورة الكهف,\u200ftwitter,\u200finstagram,\u200fدعاء السفر,\u200ffacebook,\u200fشباب البومب,\u200fhttps //ios.snapp.ir
Không có nhận xét nào:
Đăng nhận xét