太空出租箭

Python游戏太空出租箭

"""请按上\左\右键操作火箭,让它平安着陆,着陆的时候速度不能太快哦,否则就会爆炸"""
import os
from spacearrow.arrow import *  # 导入火箭类
from spacearrow.level import *  # 导入关卡类


def init_audio():
    """初始化音频"""
    try:
        import pygame        
        pygame.mixer.init()
        pygame.mixer.music.load("audios\\495046_The-War-W.wav")
        pygame.mixer.music.play(-1,0)        
        bumped_sound = pygame.mixer.Sound("audios\\中爆炸.wav")       
    except:        
        bumped_sound = None
        
    return bumped_sound


def init_screen():
    """初始化屏幕"""
    screen = Screen()
    screen.title("太空出租箭_作者:李兴球")
    screen.bgcolor("black")
    screen.bgpic(images_folder + "背景1.png")
    screen.setup(960,720)
    screen.delay(0)
    
    return screen

def makelevel():
    """生成关卡对象所需要的嵌套列表,以下代码可用关卡设计器生成。"""
    map1 = [(200,100),(-250,180),(-260,-200),(260,-200)]
    map2 = [(-200,-200),(200,180),(300,-180),(0,-90)]
    map3 = [(-100,-40),(120,160),(230,230),(-230,-230),(230,-230)]
    map4 = [(0,0),(-100,190),(230,230),(-180,-160),(130,-230),(-350,-210),(350,-0)]
    map5 = [(-100,0),(-100,190),(230,230),(-180,-160),(130,-230),(50,-210),(350,-100),(300,100)]
    maplist = [map1,map2,map3,map4,map5]
    
    return maplist

You must log in to read the rest of this article. Please log in or register as a user.