2월, 2021의 게시물 표시

pang game source (팡 게임) 소스 - 카피해서 vusual basic에서 파이썬으로 run하면 됩니다.

import  os import  pygame ################################################################################################### # 기본 초기화 (반드시 해야 하는 것들) pygame.init()  # 초기화 # 화면 크기 설정 screen_width =  640   # 가로 크기 screen_height =  480   # 세로 크기 screen = pygame.display.set_mode((screen_width, screen_height)) # 화면 타이틀 설정 pygame.display.set_caption( "PengSu PengSu" )  # 게임 이름 # FPS clock = pygame.time.Clock() ################################################################################################### # 1. 사용자 게임 초기화 (배경 화면, 게임 이미지, 좌표, 속도, 폰트 등) current_path = os.path.dirname( __file__ )  # 현재 파일의 위치 반환 image_path = os.path.join(current_path,  "images" )  # images 폴더 위치 반환 # 배경 만들기 background = pygame.image.load(os.path.join(image_path,  "background.png" ))  # 스테이지 만들기 stage = pygame.image.load(os.path.join(image_path,  "stage.png" ))  stage_size = stage.get_rect().size stage_height = stage_size[ 1 ]  # 스테이지의 높이 위에 캐릭터를 두기 위해 사용(Height) # 캐릭터 만