Beispiel #1
0
def enter():
    gfw.world.init([
        'bg', 'bg2', 'player2', 'ui', 'redozone', 'whiteozone', 'skyozone',
        'purpleozone', 'arrivepoint'
    ])
    player2.init()
    gfw.world.add(gfw.layer.player2, player2)
    global game_over_image  # 게임오버시
    game_over_image = gfw.image.load('res/game_over.png')

    global font  # 폰트
    font = gfw.font.load('res/ConsolaMalgun.ttf', 40)

    global music_bg, wav_item, explosionsound, getitemsound, clearmusic  # 음악처리
    music_bg = load_music('res/background2.mp3')  # 배경음만mp3
    wav_item = load_wav('res/crush.wav')
    explosionsound = load_wav('res/explosion.wav')
    getitemsound = load_wav('res/item.wav')
    clearmusic = load_wav('res/clearmusic.wav')

    global state
    state = STATE_GAME_OVER  # 드로우에서 처리
    start_game()  # 게임시작상태

    global clear

    clear = gfw.image.load('res/stage2clear.png')

    bg = HorzScrollBackground('space.png')
    bg.speed = 100
    gfw.world.add(gfw.layer.bg, bg)

    bg = HorzScrollBackground('spacedust.png')
    bg.speed = 150
    gfw.world.add(gfw.layer.bg2, bg)
Beispiel #2
0
def enter(select):
    global bg1, bg2, ui_start
    global brave, bright, zombie, angle, coonku
    global bravex, bravey, bravesize
    global brightx, brighty, brightsize
    global zombiex, zombiey, zombiesize
    global anglex, angley, anglesize
    global coonkux, coonkuy, coonkusize
    global bgm, effect
    bg1 = HorzScrollBackground('Menu_bg_01.png')
    bg1.speed = 10
    bg2 = HorzScrollBackground('Menu_bg_02.png')
    bg2.speed = 50
    brave = load_image('./res/Menu_cookie_01.png')
    bright = load_image('./res/Menu_cookie_02.png')
    zombie = load_image('./res/Menu_cookie_03.png')
    angle = load_image('./res/Menu_cookie_04.png')
    coonku = load_image('./res/Menu_cookie_05.png')
    ui_start = load_image('./res/play.png')

    bravex = 0
    bravey = 270
    bravesize = (270, 270)

    brightx = 0
    brighty = 288
    brightsize = (288, 288)

    zombiex = 0
    zombiey = 360
    zombiesize = (360, 360)

    anglex = 0
    angley = 320
    anglesize = (320, 320)

    coonkux = 0
    coonkuy = 344
    coonkusize = (344, 344)
    show_cursor()

    bgm = load_wav('./res/bgm_main_rockstar.wav')
    bgm.get_volume()
    bgm.repeat_play()

    effect = load_wav('./res/ui_3.wav')
    effect.get_volume()
    pass
Beispiel #3
0
def enter():
    gfw.world.init(['bg', 'coin', 'bullet', 'player', 'ui'])
    center = get_canvas_width() // 2, get_canvas_height() // 2
    bg = HorzScrollBackground('bg.png')
    bg.speed = 300
    gfw.world.add(gfw.layer.bg, bg)
    global music_bg, coin, jump, die
    music_bg = load_music('res/background.mp3')
    coin = load_wav('res/coin.wav')
    jump = load_wav('res/jump.wav')
    die = load_wav('res/die.wav')
    music_bg.repeat_play()
    global player
    player = Player()
    player.bg = bg
    gfw.world.add(gfw.layer.player, player)

    global score
    score = Score(canvas_width - 20, canvas_height - 50)
    gfw.world.add(gfw.layer.ui, score)

    global font
    font = gfw.font.load(gobj.RES_DIR + '/segoeprb.ttf', 40)

    global state
    state = STATE_IN_GAME

    global game_over_image
    game_over_image = gfw.image.load('res/game_over.png')
Beispiel #4
0
def enter():
    print('horz_state enter()')
    #global bg_music
    #bg_music = load_wav(gobj.res('sound/InGameMusic.wav'))
    #bg_music.set_volume(20)
    # bg_music.repeat_play()
    gfw.world.init(['bg', 'platform', 'enemy', 'item', 'player', 'ui'])

    center = get_canvas_width() // 2, get_canvas_height() // 2

    # GameController
    for n, speed in [(1, 10), (2, 100), (3, 150)]:
        bg = HorzScrollBackground('cookie_run_bg_%d.png' % n)
        bg.speed = speed
        gfw.world.add(gfw.layer.bg, bg)

    global player
    player = Player()
    player.bg = bg
    gfw.world.add(gfw.layer.player, player)

    score = 0
    heart = 10

    stage_gen.load(gobj.res('stage_01.txt'))
Beispiel #5
0
def enter():
    gfw.world.init(['bg', 'platform', 'spike', 'player', 'ui'])

    bg = HorzScrollBackground('game_background.png')
    bg.speed = 50
    gfw.world.add(gfw.layer.bg, bg)

    global bgm
    bgm = load_music('Assets/LetsMarch.ogg')
    bgm.set_volume(50)
    bgm.repeat_play()

    global player
    player = Player()
    gfw.world.add(gfw.layer.player, player)

    global font
    font = gfw.font.load('Assets/Maplestory Bold.ttf', 25)

    stage_gen.load(gobj.res('stage_01.txt'))

    prito.init()
    prito.reset()
    gfw.world.add(gfw.layer.ui, prito)
    global prito_cooldown
    prito_cooldown = random.uniform(10, 15)

    progress.init()
    gfw.world.add(gfw.layer.ui, progress)
Beispiel #6
0
    def __init__(self):
        global grass, bg
        for n, speed in [(1, 30)]:
            bg = HorzScrollBackground('image/background1.png')
            bg.speed = speed
        grass = Grass()

        global zombie_time
        zombie_time = 1
Beispiel #7
0
    def __init__(self):
        global grass, bg, portal
        portal = Portal3()
        for n, speed in [(1, 30)]:
            bg = HorzScrollBackground('image/background1.png')
            bg.speed = speed
        grass = Grass()
        Monster2.load_all_images()
        global zombie_time

        zombie_time = 4
Beispiel #8
0
def enter():
    gfw.world.init(['bg', 'enemy', 'player'])

    center = get_canvas_width() // 2, get_canvas_height() // 2

    for n, speed in [(1, 10), (2, 100), (3, 150)]:
        bg = HorzScrollBackground('cookie_run_bg_%d.png' % n)
        bg.speed = speed
        gfw.world.add(gfw.layer.bg, bg)

    global player
    player = Player()
    player.bg = bg
    gfw.world.add(gfw.layer.player, player)
Beispiel #9
0
def build_world():
    gfw.world.init([
        'bg', 'platform', 'enemy', 'boss', 'item', 'player', 'life', 'score',
        'ui', 'menu'
    ])
    Player.load_all_images()
    Jelly.load_all_images()

    center = get_canvas_width() // 2, get_canvas_height() // 2

    for n, speed in [(1, 10), (2, 100), (3, 150)]:
        bg = HorzScrollBackground('map_bg/bg_%d.png' % n, 'sound/main.mp3')
        bg.speed = speed
        gfw.world.add(gfw.layer.bg, bg)

    global font
    font = load_font(gobj.RES_DIR + 'font/CookieRun Regular.ttf', 30)

    global life
    life = Life()
    gfw.world.add(gfw.layer.life, life)

    global score
    score = Score(canvas_width / 2 - 30, canvas_height - 65, (0, 0, 0), 30)
    gfw.world.add(gfw.layer.score, score)

    stage_gen.load(gobj.res('stage_boss.txt'))

    global obs_sound, crash_sound
    obs_sound = load_wav(gobj.RES_DIR + 'sound/obs.wav')
    obs_sound.set_volume(50)
    crash_sound = load_wav(gobj.RES_DIR + 'sound/crash.wav')
    crash_sound.set_volume(30)

    global player
    player = Player(name)
    gfw.world.add(gfw.layer.player, player)

    l, b, w, h = get_canvas_width() - 100, get_canvas_height() - 100, 50, 50
    btn = Button("pause_", l, b, w, h, font, "", lambda: pause_set())
    gfw.world.add(gfw.layer.ui, btn)

    global paused, open
    paused = False
    open = False
Beispiel #10
0
def enter():
    gfw.world.init(['bg', 'platform', 'enemy', 'boss', 'item', 'player'])
    Player.load_all_images()
    Jelly.load_all_images()

    center = get_canvas_width() // 2, get_canvas_height() // 2

    for n, speed in [(1, 10), (2, 100), (3, 150)]:
        bg = HorzScrollBackground('map_bg/bg_%d.png' % n)
        bg.speed = speed
        gfw.world.add(gfw.layer.bg, bg)

    global player
    player = Player()
    #    player.bg = bg
    gfw.world.add(gfw.layer.player, player)

    global font
    font = load_font(gobj.RES_DIR + 'font/CookieRun Regular.ttf', 40)

    stage_gen.load(gobj.res('stage_boss.txt'))
Beispiel #11
0
def enter():
    gfw.world.init(
        ['bg', 'bg2', 'cloud', 'ball', 'player1', 'player2', 'goal', 'score'])

    bg = Background('bg.jpg')
    gfw.world.add(gfw.layer.bg, bg)
    bg2 = Background2('grass.jpg')
    gfw.world.add(gfw.layer.bg2, bg2)
    cloud = HorzScrollBackground('clouds2.png')
    cloud.speed = 10

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

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

    global player1, player2
    player1 = Player()
    gfw.world.add(gfw.layer.player1, player1)
    player2 = Player2()
    gfw.world.add(gfw.layer.player2, player2)

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

    global score
    score = Score(get_canvas_width() // 2 + 40, 580)
    gfw.world.add(gfw.layer.score, score)

    game_set.init()

    global time, font, check, DELTA_TIME, GOAL_image, goal_sound
    time = 60
    font = gfw.font.load(('res/NAL Hand.otf'), 50)
    check = 0
    DELTA_TIME = 0
    GOAL_image = gfw.image.load('res/goalll.png')
    goal_sound = load_wav('res/shout.wav')
    goal_sound.set_volume(50)
Beispiel #12
0
def enter(select):
    gfw.world.init(['bg', 'platform', 'enemy', 'item', 'player', 'ui'])
    global bgm, effect_j, effect_s, effect_jelly, effect_hp, effect_obs
    bgm = load_music('./res/Cookie Run Ovenbreak - Theme Song Breakout 1.mp3')
    if select == -1:
        effect_j = load_wav('res/ch02jump.wav')
        effect_s = load_wav('res/ch01slide.wav')
    elif select == 0:
        effect_j = load_wav('res/ch02jump.wav')
        effect_s = load_wav('res/ch02slide.wav')
    elif select == 5:
        effect_j = load_wav('res/ch07jump.wav')
        effect_s = load_wav('res/ch07slide.wav ')
    elif select == 14:
        effect_j = load_wav('res/ch02jump.wav')
        effect_s = load_wav('res/ch01slide.wav')
    elif select == 3:
        effect_j = load_wav('res/ch05jump.wav')
        effect_s = load_wav('res/ch05slide.wav')
    effect_jelly = load_wav('res/g_jelly.wav')
    effect_hp = load_wav('res/i_small_energy.wav')
    effect_obs = load_wav('res/g_obs1.wav')

    effect_s.get_volume()
    effect_j.get_volume()
    effect_jelly.get_volume()
    effect_hp.get_volume()
    effect_obs.get_volume()
    bgm.get_volume()

    bgm.repeat_play()

    center = get_canvas_width() // 2, get_canvas_height() // 2

    for n, speed in [(1, 10), (2, 100)]:
        bg = HorzScrollBackground('Episode01_bg_0%d.png' % n)
        bg.speed = speed
        gfw.world.add(gfw.layer.bg, bg)

    global player
    player = Player(select)
    player.bg = bg
    gfw.world.add(gfw.layer.player, player)

    global ui
    ui = HPui.Hpui(0.05)
    if player.select == 3:
        ui.set_dwidth(1, 0.05)
    gfw.world.add(gfw.layer.ui, ui)

    stage_gen.load(gobj.res('stage_01.txt'))
    global font, score, targetscore
    font = gfw.font.load('res/CookieRun Regular.ttf', 35)
    score = 0
    targetscore = 0

    global runfast, fast_time
    runfast = False
    fast_time = None

    global die_time