def enter(): gfw.world.init([ 'bg', 'enemy', 'boss', 'bullet', 'player', 'boss_bullet', 'effect', 'ui', 'item' ]) global player, charnum player = Player() Player.player_type = charnum gfw.world.add(gfw.layer.player, player) global dis_score, score dis_score = Score(canvas_width - 20, canvas_height - 50) gfw.world.add(gfw.layer.ui, dis_score) score = Score(canvas_width - 20, canvas_height - 100) gfw.world.add(gfw.layer.ui, score) global font font = gfw.font.load(gobj.RES_DIR + '/BM.ttf', 40) life_gauge.load() bg = VertScrollBackground('/map_01.png') bg.speed = 100 gfw.world.add(gfw.layer.bg, bg) global power_item, dual_item power_item = gfw.image.load(gobj.RES_DIR + '/powershot.png') dual_item = gfw.image.load(gobj.RES_DIR + '/dualshot.png') global music_bg, music_bg2, wav_mon_die, player_voice, player_hit_wav, wav_boss_dead, wav_siren, get_money, get_item music_bg = load_music(gobj.RES_DIR + '/bg_music.mp3') music_bg2 = load_music(gobj.RES_DIR + '/boss_stage_bg.mp3') wav_mon_die = load_wav(gobj.RES_DIR + '/enemy_die.wav') player_voice = load_wav(gobj.RES_DIR + '/go.wav') player_hit_wav = load_wav(gobj.RES_DIR + '/hit.wav') wav_siren = load_wav(gobj.RES_DIR + '/siren.wav') wav_boss_dead = load_wav(gobj.RES_DIR + '/boss_dead.wav') get_money = load_wav(gobj.RES_DIR + '/get_coin.wav') get_item = load_wav(gobj.RES_DIR + '/get_item.wav') music_bg.repeat_play() player_voice.play() global state state = START_GAME enemy_gen.reset() global boss_ox, boss_ap boss_ox, boss_ap = 0, 1 boss.Boss().LASER_INTERVAL = 0.5 global time, boss_die time = 0 boss_die = False highscore.load() Gameover_state.num = charnum
def enter(): gfw.world.init(['bg', 'missile', 'player', 'bullet', 'boss', 'ui']) pattern.init() global player player = Player() gfw.world.add(gfw.layer.player, player) global boss boss = Boss() gfw.world.add(gfw.layer.boss, boss) global bg bg = VertScrollBackground('./res/world02.png') leaf = VertScrollBackground('./res/world02c2.png') gfw.world.add(gfw.layer.bg, bg) gfw.world.add(gfw.layer.bg, leaf) global font font = gfw.font.load('res/ConsolaMalgun.ttf', 20) global sound_damage, sound_pldead, music_bg music_bg = load_music('res/bg_sound.mp3') sound_damage = load_wav('res/se_damage00.wav') sound_pldead = load_wav('res/se_pldead00.wav') sound_damage.set_volume(20) sound_pldead.set_volume(20) music_bg.set_volume(50) global pattern_index pattern_index = 0 p1 = pattern.Pattern1() pattern.add(p1) p2 = pattern.Pattern2() pattern.add(p2) life_gauge.load() highscore.load() start_game()
def enter(): gfw.world.init([ 'bg', 'enemy', 'bullet', 'player', 'ui', 'e_bullet', 'coin', ]) center = get_canvas_width() // 2, get_canvas_height() // 2 bg = VertScrollBackground('bg_01.png') bg.speed = 100 gfw.world.add(gfw.layer.bg, bg) global music_bgm, monster_bgm, attacked_bgm, coin_bgm music_bgm = load_music('res/dragon_flight.mp3') music_bgm.repeat_play() monster_bgm = load_wav('res/monster_die.wav') attacked_bgm = load_wav('res/attacked.wav') coin_bgm = load_wav('res/coin.wav') global player player = Player() player.bg = bg gfw.world.add(gfw.layer.player, player) global score score = Score(canvas_width // 2 + 40, canvas_height - 20) gfw.world.add(gfw.layer.ui, score) global font font = gfw.font.load(gobj.RES_DIR + '/segoeprb.ttf', 40) life_gauge.load() skill_gauge.load()
def enter(): gfw.world.init(['bg','bg2' , 'meteor', 'player', 'ui', 'rockethead','rocketbody','rocketleft','rocketlight', 'shield']) player.init() gfw.world.add(gfw.layer.player, player) global game_over_image # 게임오버시 game_over_image = gfw.image.load('res/game_over.png') global stage1clear #스테이지1클리어시 stage1clear=gfw.image.load('res/stage1clear.png') global font # 폰트 font = gfw.font.load('res/ConsolaMalgun.ttf', 40) global music_bg, wav_item, explosionsound,getitemsound,clear # 음악처리 music_bg = load_music('res/background.mp3') # 배경음만mp3 wav_item = load_wav('res/getitem.wav') explosionsound = load_wav('res/explosion.wav') getitemsound=load_wav('res/item.wav') global state state = STATE_GAME_OVER # 드로우에서 처리 start_game() # 게임시작상태 #로켓그려주기 global rockethead rockethead = gfw.image.load('res/rockethead.png') global rocketbody rocketbody = gfw.image.load('res/rocketbody.png') global rocketleft rocketleft = gfw.image.load('res/rocketleft.png') global rocketlight rocketlight = gfw.image.load('res/rocketlight.png') global shield shield = gfw.image.load('res/shieldora.png') # 무브 global move move = Move() bg =VertScrollBackground('space.png') bg.speed = 100 gfw.world.add(gfw.layer.bg, bg) bg = VertScrollBackground('spacedust.png') bg.speed = 150 gfw.world.add(gfw.layer.bg2, bg)
def enter(): gfw.world.init(['bg', 'enemy', 'bullet', 'player', 'ui', 'enemybullet']) global player player = Player() 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 bg bg = VertScrollBackground('../res/background.png', 10) gfw.world.add(gfw.layer.bg, bg) life_gauge.load()
def enter(): gfw.world.init( ['bg', 'enemy', 'bullet', 'player', 'ui', 'bullet_enemy', 'item']) center = get_canvas_width() // 2, get_canvas_height() // 2 #background speed_city = 20 bg = VertScrollBackground('bg_city.png') bg.speed = speed_city gfw.world.add(gfw.layer.bg, bg) speed_clouds = 30 bg = VertScrollBackground('clouds.png') bg.speed = speed_clouds gfw.world.add(gfw.layer.bg, bg) global player player = Player() #player.bg=bg gfw.world.add(gfw.layer.player, player) global boss 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) life_gauge.load() global music_bg, wav_item, wav_enemydead, wav_enemyhit, wav_playerhit, game_over_image music_bg = load_music('res/04.mp3') wav_item = load_wav('res/item.wav') wav_enemydead = load_wav('res/enemydead.wav') wav_enemyhit = load_wav('res/enemyhit.wav') wav_playerhit = load_wav('res/playerhit.wav') game_over_image = gfw.image.load('res/game_over.png') global player_life global item music_bg.repeat_play() global state state = STATE_IN_GAME
def enter(): gfw.world.init(['bg', 'enemy', 'bullet', 'player', 'cloud', 'ui']) global player player = Player() gfw.world.add(gfw.layer.player, player) bg = VertScrollBackground('bg_city.png') bg.speed = 10 gfw.world.add(gfw.layer.bg, bg) cloud = VertScrollBackground('clouds.png') cloud.speed = 20 gfw.world.add(gfw.layer.cloud, cloud) 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) life_gauge.load()