-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
44 lines (30 loc) · 1 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#from operator import truediv
import pygame
import os
import random
pygame.init()
width_screen = 1200
height_screen = 600
display_surface = pygame.display.set_mode((width_screen, height_screen)) #display 크기
time_clok = pygame.time.Clock() #시간 측정
pygame.display.set_caption("Santa run") #window 이름
WHITE = (255,255,255)
BLACK = (0,0,0)
player = pygame.image.load("Player.png")
player = pygame.transform.scale(player, (200, 150))
player_Rect = player.get_rect()
player_Rect.centerx = round(0)
player_Rect.centery = round(500)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if player_Rect.x > width_screen:
player_Rect.x = 0 - player_Rect.width
display_surface.fill(WHITE)
player_Rect.x += 100
display_surface.blit(player, player_Rect)
pygame.display.flip()
time_clok.tick(3)
pygame.quit()