python打地鼠游戏完整代码,python打地鼠游戏规则

这篇文章主要介绍了python打地鼠游戏选题的需求分析,具有一定借鉴价值,需要的朋友可以参考下。希望大家阅读完这篇文章后大有收获,下面让小编带着大家一起了解一下。

Source code download: 本文相关源码

大家好,小编来为大家解答以下问题,打地鼠python程序设计说明,打地鼠游戏界面设计,今天让我们一起来看看吧!

直接上代码

import random
import sys
import os
import pygame

# 配置
CURPATH = os.getcwd()
SCREENSIZE = (993, 477)
# 锤子图片两张
HAMMER_IMAGEPATHS = [os.path.join(CURPATH, 'images/hammer0.png'),
                     os.path.join(CURPATH, 'images/hammer1.png')]
# 开始图片
GAME_BEGIN_IMAGEPATHS = [os.path.join(CURPATH, 'images/begin.png'),
                         os.path.join(CURPATH, 'images/begin1.png')]

# 重新开始图标
GAME_AAIN_IMAGEPATHS = [os.path.join(CURPATH, 'images/again1.png'),
                         os.path.join(CURPATH, 'images/again2.png')]

# 背景图
GAME_BG_IMAGEPATH = os.path.join(CURPATH, 'images/background.png')

# 结束背景图
GAME_END_IMAGEPATH = os.path.join(CURPATH, 'images/end.png')

MOLE_IMAGEPATHS = [os.path.join(CURPATH, 'images/mole_1.png'),
                   os.path.join(CURPATH, 'images/mole_laugh1.png'),
                   os.path.join(CURPATH, 'images/mole_laugh2.png'),
                   os.path.join(CURPATH, 'images/mole_laugh3.png')]
# 随机位置
HOLE_POSITIONS = [(90, -20), (405, -20), (720, -20), (90, 140), (405, 140), (720, 140), (90, 290), (405, 290),
                  (720, 290)]
BGM_PATH = os.path.join(CURPATH, 'audios/bgm.mp3')

# --------------------------------------------------------------------------
COUNT_DOWN_SOUND_PATH = os.path.join(CURPATH, 'audios/count_down.wav')
HAMMERING_SOUND_PATH = os.path.join(CURPATH, 'audios/hammering.wav')

FONT_PATH = os.path.join(CURPATH, 'font/Gabriola.ttf')
BROWN = (150, 75, 0)
WHITE = (255, 255, 255)
RED = (255, 0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值