python新冠病毒泡泡堂游戏,音乐,素材,可执行文件 等下载网址:
链接:https://pan.baidu.com/s/1F359-kUuGHYznrjXPfZoxw
提取码:fne9
python新冠病毒泡泡堂游戏.wmv
"""
新型冠状病毒泡泡堂游戏.py
本程序借用了pygame的混音器模块,所以需要安装pygame模块。
需要精灵模块1.33版支持请卸载老版本,重新安装最新版本的精灵模块。
安装方法 pip install sprites
程序中迷宫房间是画出来的,当然虫子是不能穿越过去,也不能碰到病毒...
按上下左右键操作虫子移动,按空格键放炸弹。
"""
from sprites import *
from pygame import mixer
def draw_frame(obj,margin):
"""用obj角色画边框,margin为边距
本函数用for循环直接画一个正方形也可以。
"""
sw = obj.screen.window_width()
sh = obj.screen.window_height()
bug.topleft() # 移到左上角
bug.addy(-margin)
x,y = bug.position()
cors = [(x+sw,y),(x+sw,y+margin),(x,y+margin)]
f1 = bug.polygon(cors)
bug.bottomleft() # 移到左下角
x,y = bug.position()
cors = [(x+sw,y),(x+sw,y+margin),(x,y+margi