From e77a067de5413fd1e4dd6051866e748771965b7f Mon Sep 17 00:00:00 2001 From: pwb8f3ix9 <2533327493@qq.com> Date: Fri, 31 May 2024 22:00:11 +0800 Subject: [PATCH] ADD file via upload --- cfg.py | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 cfg.py diff --git a/cfg.py b/cfg.py new file mode 100644 index 0000000..b2fb2d8 --- /dev/null +++ b/cfg.py @@ -0,0 +1,56 @@ +'''配置文件''' +import os + + +# FPS +FPS = 60 +# 屏幕 +SCREENWIDTH = 288 +SCREENHEIGHT = 512 +# 管道之间的空隙 +PIPE_GAP_SIZE = 100 +# 图片 +NUMBER_IMAGE_PATHS = { + '0': os.path.join(os.getcwd(), 'resources/images/0.png'), + '1': os.path.join(os.getcwd(), 'resources/images/1.png'), + '2': os.path.join(os.getcwd(), 'resources/images/2.png'), + '3': os.path.join(os.getcwd(), 'resources/images/3.png'), + '4': os.path.join(os.getcwd(), 'resources/images/4.png'), + '5': os.path.join(os.getcwd(), 'resources/images/5.png'), + '6': os.path.join(os.getcwd(), 'resources/images/6.png'), + '7': os.path.join(os.getcwd(), 'resources/images/7.png'), + '8': os.path.join(os.getcwd(), 'resources/images/8.png'), + '9': os.path.join(os.getcwd(), 'resources/images/9.png') + } +BIRD_IMAGE_PATHS = { + 'red': {'up': os.path.join(os.getcwd(), 'resources/images/redbird-upflap.png'), + 'mid': os.path.join(os.getcwd(), 'resources/images/redbird-midflap.png'), + 'down': os.path.join(os.getcwd(), 'resources/images/redbird-downflap.png')}, + 'blue': {'up': os.path.join(os.getcwd(), 'resources/images/bluebird-upflap.png'), + 'mid': os.path.join(os.getcwd(), 'resources/images/bluebird-midflap.png'), + 'down': os.path.join(os.getcwd(), 'resources/images/bluebird-downflap.png')}, + 'yellow': {'up': os.path.join(os.getcwd(), 'resources/images/yellowbird-upflap.png'), + 'mid': os.path.join(os.getcwd(), 'resources/images/yellowbird-midflap.png'), + 'down': os.path.join(os.getcwd(), 'resources/images/yellowbird-downflap.png')} + } +BACKGROUND_IMAGE_PATHS = { + 'day': os.path.join(os.getcwd(), 'resources/images/background-day.png'), + 'night': os.path.join(os.getcwd(), 'resources/images/background-night.png') + } +PIPE_IMAGE_PATHS = { + 'green': os.path.join(os.getcwd(), 'resources/images/pipe-green.png'), + 'red': os.path.join(os.getcwd(), 'resources/images/pipe-red.png') + } +OTHER_IMAGE_PATHS = { + 'gameover': os.path.join(os.getcwd(), 'resources/images/gameover.png'), + 'message': os.path.join(os.getcwd(), 'resources/images/message.png'), + 'base': os.path.join(os.getcwd(), 'resources/images/base.png') + } +# 音频路径 +AUDIO_PATHS = { + 'die': os.path.join(os.getcwd(), 'resources/audios/die.wav'), + 'hit': os.path.join(os.getcwd(), 'resources/audios/hit.wav'), + 'point': os.path.join(os.getcwd(), 'resources/audios/point.wav'), + 'swoosh': os.path.join(os.getcwd(), 'resources/audios/swoosh.wav'), + 'wing': os.path.join(os.getcwd(), 'resources/audios/wing.wav') + } \ No newline at end of file