Esempio n. 1
0
def enter():
    global stage
    stage = 1
    gfw.world.init(
        ['bg', 'ui', 'car', 'card', 'plant', 'bullet', 'zombie', 'sun'])

    bg.init()
    gfw.world.add(gfw.layer.bg, bg)

    static_ui.init()
    gfw.world.add(gfw.layer.ui, static_ui)
    generator.init(stage)

    for i in range(5):
        car = Car((10, i * 100 + 70))
        gfw.world.add(gfw.layer.car, car)

    global font
    font = gfw.font.load('../res/moris9.ttf', 25)

    global zombie_generate_time
    zombie_generate_time = 0.0

    global start
    start = False
Esempio n. 2
0
def enter():
    global bl, br, bt, bb

    bl, br, bt, bb = get_canvas_width() // 2 - 170, get_canvas_width(
    ) // 2 + 170, get_canvas_height() // 2 + 30 - 170, get_canvas_height(
    ) // 2 + 30 + 170

    gfw.world.init(['ui', 'dice', 'bullet', 'enemy'])
    ui.init()
    generator.init()

    gfw.world.add(gfw.layer.ui, ui)

    global font, stagefont
    font = gfw.font.load('res/ConsolaMalgun.ttf', 15)
    stagefont = gfw.font.load('res/ConsolaMalgun.ttf', 40)

    global dicecost, fastcost, slowcost, multicost

    global isclick, target

    initgame()

    isclick = False
    target = None

    global buttonsound

    buttonsound = load_wav('res/button.wav')
    buttonsound.set_volume(15)
Esempio n. 3
0
def enter():
	gfw.world.init(['background', 'missile', 'player'])	
	background.init(player)
	player.init()
	generator.init()
	gfw.world.add(gfw.layer.background, background)
	gfw.world.add(gfw.layer.player, player)
Esempio n. 4
0
def enter():
    gfw.world.init(['bg', 'missile', 'player'])

    generator.init()

    bg.init(player)
    gfw.world.add(gfw.layer.bg, bg)

    player.init()
    gfw.world.add(gfw.layer.player, player)
Esempio n. 5
0
def enter():
    gfw.world.init(['bg', 'missile', 'item', 'player'])
    generator.init()

    bg.init()
    gfw.world.add(gfw.layer.bg, bg)
    player.init()
    gfw.world.add(gfw.layer.player, player)

    global game_over_image, font
    game_over_image = gfw.image.load('res/game_over.png')
    font = gfw.font.load('res/ConsolaMalgun.ttf', 35)

    global state, score
    state = STATE_IN_GAME
    score = 0
Esempio n. 6
0
def init():
    global logHandle, logName
    bob.getConfigData('config.txt')
    logName = bob.logFileName
    #logging set up
    logger = logging.getLogger("Manager")
    logger.setLevel(logging.DEBUG)
    logHandle = logging.FileHandler(logName)
    formatting = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    logHandle.setFormatter(formatting)
    logger.addHandler(logHandle)
    #check bob paths
    logger.info('LOGGING STARTED')
    bob.testConfig()
    specialist.init(bob.VLCpath,bob.testPath)
    tests = getTests()
    mp3Opt = specialist.optionsMP3
    stateExpert.setTests(tests['WAVE'],tests['MP3'],mp3Opt)
    generator.init(bob.testPath)
    #TODO: Bug, if we have multiple ['] we only sanitize it once
    bob.updateTestData()
def enter():
    global MAP_SIZE
    MAP_SIZE = get_canvas_width() // 7 * 5, get_canvas_height()

    gfw.world.initMapSize(*MAP_SIZE)

    # 월드에 bg, ui 추가
    # bg = 뒤에 나오는 갈색 화면
    # bg_game = 게임 화면
    # player = 플레이어 화면
    # ui = ui 관련 화면
    gfw.world.init([
        'bg', 'bg_game', 'player', 'bullet', 'enemy', 'enemy_bullet',
        'special_enemy_bullet', 'ui'
    ])

    # bg 설정
    global bg
    #bg = background.Background('bg_stage.png', 0, 0, get_canvas_width(), get_canvas_height(), 255)
    #gfw.world.add(gfw.layer.bg, bg)

    bg = background.Background('bg_stage.PNG', MAP_SIZE[0], 0,
                               get_canvas_width() - MAP_SIZE[0], MAP_SIZE[1],
                               255)
    gfw.world.add(gfw.layer.ui, bg)
    bg = background.Background('bg_stage_right.PNG', MAP_SIZE[0], 0,
                               get_canvas_width() - MAP_SIZE[0], MAP_SIZE[1],
                               50)
    gfw.world.add(gfw.layer.ui, bg)
    bg = background.Background('reimu03.PNG', MAP_SIZE[0], 100,
                               get_canvas_width() - MAP_SIZE[0],
                               MAP_SIZE[1] // 2, 255)
    gfw.world.add(gfw.layer.ui, bg)

    bg = background.VertScrollBackground('bg_stage_03.png', MAP_SIZE[0],
                                         MAP_SIZE[1], 255)
    bg.speed = 800
    gfw.world.add(gfw.layer.bg, bg)

    #image_left, image_right, x, y, cw, ch, standard_y, speed_down, speed_sideway01, speed_sideway02, speed_sideway03
    #bg2 = background.VertexSolidScrollBackground('tree_02.png', 0, 0, 1825, 1440, 1440, 200)
    #gfw.world.add(gfw.layer.bg_game, bg2)

    bg = background.VertScrollBackground('clouds.png', 1825, 2000, 150)
    bg.speed = 40
    #gfw.world.add(gfw.layer.bg, bg)

    # 플레이어 초기화
    global player
    player = player.Player()
    player.level = 2
    player.bullet_speed = 8
    gfw.world.add(gfw.layer.player, player)

    # 탄 관련 초기화
    generator.init()

    # 점수판 관련 초기화
    global gap_w, gap_h
    gap_w = MAP_SIZE[0] // 10
    gap_h = MAP_SIZE[1] // 15

    global score, Hiscore
    score = Score(MAP_SIZE[0] + gap_w * 2, MAP_SIZE[1] - gap_h * 2)
    Hiscore = Score(MAP_SIZE[0] + gap_w * 2, MAP_SIZE[1] - gap_h)
    gfw.world.add(gfw.layer.ui, score)
    gfw.world.add(gfw.layer.ui, Hiscore)
    Hiscore.score = 1

    # 폰트 관련 초기화
    global font, font_size
    font_size = MAP_SIZE[0] // 50
    font = gfw.font.load(resource + 'ConsolaMalgun.ttf', font_size)

    # 배경음악 관련 초기화
    global bg_music
    bg_music = load_wav(resource + 'stage01_background.wav')
    bg_music.set_volume(gfw.world.getSound())
    bg_music.play(1)

    # 적 관련 초기화
    stage_gen.init()
Esempio n. 8
0
def change_stage():
    global stage
    generator.init(stage)