Пример #1
0
    def updateMode2(self):
        if self.state == 0:
            if self.cnt > 120:
                self.nextState()
        elif self.state == 1:
            # 右の画面外に移動
            if self.cnt == 1:
                obj = enemy.Splash.appendDr(self.coreX, self.coreY -8, gcommon.C_LAYER_SKY, math.pi, math.pi/6, 20)
                obj.ground = True
                obj = enemy.Splash.appendDr(self.coreX -16, self.coreY, gcommon.C_LAYER_SKY, math.pi, math.pi/6, 20)
                obj.ground = True
                obj = enemy.Splash.appendDr(self.coreX, self.coreY +8, gcommon.C_LAYER_SKY, math.pi, math.pi/6, 20)
                obj.ground = True
            if self.coreX < 300:
                self.coreX += 4
            if self.cnt == 120:
                gcommon.scroll_flag = True
                # ボスコアを生成
                ObjMgr.addObj(BossLast1Core(self.coreX, self.coreY, self.isBossRush))
                if self.isBossRush == False:
                    ObjMgr.addObj(enemy.Delay(BossLastBaseExplosion, [], 240))
                    BGM.play(BGM.BOSS_LAST)
        if self.x <= -160:
            self.remove()

        self.rad = (self.rad + math.pi/30) % (math.pi * 2)
Пример #2
0
    def update(self):
        self.star_pos -= 0.25
        if self.star_pos<0:
            self.star_pos += 256
        self.mouseManager.update()
        if self.state == 0:
            if self.cnt == 20:
                BGM.play(BGM.STAGE_SELECT)
            if self.cnt > 20:
                if gcommon.checkUpP():
                    if self.currentStageInfo.parentList != None:
                        lst = self.currentStageInfo.parentList[0].nextStageList
                        if len(lst) > 1:
                            BGM.sound(gcommon.SOUND_MENUMOVE)
                            self.currentIndex -= 1
                            if self.currentIndex < 0:
                                self.currentIndex = len(lst) -1
                            self.currentStageInfo = lst[self.currentIndex]
                elif gcommon.checkDownP():
                    if self.currentStageInfo.parentList != None:
                        lst = self.currentStageInfo.parentList[0].nextStageList
                        if lst != None and len(lst) > 1:
                            BGM.sound(gcommon.SOUND_MENUMOVE)
                            self.currentIndex += 1
                            if self.currentIndex >= len(lst):
                                self.currentIndex = 0
                            self.currentStageInfo = lst[self.currentIndex]
                elif gcommon.checkRightP():
                    lst = self.currentStageInfo.nextStageList
                    if lst != None:
                        BGM.sound(gcommon.SOUND_MENUMOVE)
                        if self.currentIndex >= len(lst):
                            self.currentIndex = len(lst) -1
                        self.currentStageInfo = self.currentStageInfo.nextStageList[self.currentIndex]
                        #gcommon.debugPrint("index = " + str(self.currentIndex) + " " + self.currentStageInfo.stage)
                elif gcommon.checkLeftP():
                    if self.currentStageInfo.parentList != None:
                        BGM.sound(gcommon.SOUND_MENUMOVE)
                        self.currentStageInfo = self.currentStageInfo.parentList[0]
                        self.currentIndex = 0
                        #gcommon.debugPrint("index = " + str(self.currentIndex) + " " + self.currentStageInfo.stage)
                elif gcommon.checkShotKeyP():
                    BGM.stop()
                    BGM.sound(gcommon.SOUND_GAMESTART)
                    self.state = 1
                    self.cnt = 0
                else:
                    if self.mouseManager.visible:
                        stageInfo = self.getMouseSelectedStageInfo(self.rootStageInfo)
                        if stageInfo != None:
                            self.currentStageInfo = stageInfo

        else:
            #print(str(self.cnt))
            if self.cnt > 40:
                gcommon.app.startNextStage(self.currentStageInfo.stage)
        self.cnt += 1
Пример #3
0
    def update(self):
        self.star_pos -= 0.25
        if self.star_pos<0:
            self.star_pos += 256
        self.mouseManager.update()
        if self.state == 0:
            if self.cnt == 20:
                BGM.play(BGM.STAGE_SELECT)
            if self.cnt > 20:
                if gcommon.checkUpP():
                    BGM.sound(gcommon.SOUND_MENUMOVE)
                    self.currentIndex -= 1
                    if self.currentIndex < 0:
                        self.currentIndex = len(self.nextStageList) -1
                elif gcommon.checkDownP():
                    BGM.sound(gcommon.SOUND_MENUMOVE)
                    self.currentIndex += 1
                    if self.currentIndex >= len(self.nextStageList):
                        self.currentIndex = 0
                elif gcommon.checkShotKeyP():
                    BGM.stop()
                    BGM.sound(gcommon.SOUND_GAMESTART)
                    self.state = 1
                    self.cnt = 0
                else:
                    for i, stageInfo in enumerate(self.nextStageList):
                        rect = gcommon.Rect.createWH(stageInfo.x + StageSelect.nodeBaseX, stageInfo.y + StageSelect.nodeBaseY, 32, 16)
                        if rect.contains(pyxel.mouse_x, pyxel.mouse_y):
                            self.currentIndex = i

        else:
            #print(str(self.cnt))
            if self.cnt > 40:
                gcommon.app.startNextStage(self.nextStageList[self.currentIndex].stage)
        self.currentStageInfo = self.nextStageList[self.currentIndex]
        self.cnt += 1
Пример #4
0
 def init(self):
     pyxel.image(1).load(0, 0, "assets/launch1.png")
     pyxel.image(2).load(0, 0, "assets/launch2.png")
     BGM.play(BGM.LAUNCH)
Пример #5
0
 def init(self):
     BGM.play(BGM.TITLE)
Пример #6
0
    def initStage(cls, stage, restart):
        gcommon.breakableMapData = False
        pyxel.tilemap(0).refimg = 1
        gcommon.waterSurface_y = 256 * 8.0
        gcommon.scrollController = None
        # タイルマップクリア
        __class__.clearTilemap()

        if stage == "1A":
            #pyxel.load("assets/graslay_vehicle01.pyxres", False, False, True, True)
            pyxel.image(1).load(0, 0, "assets/graslay1.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = False
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/graslay1.pyxmap")
            MapData.loadMapData(1, "assets/graslay1b.pyxmap")
            MapData.loadMapAttribute("assets/graslay1.mapatr")
            pyxel.tilemap(1).refimg = 1
            if restart or GameSession.gameMode == gcommon.GAMEMODE_CUSTOM:
                # 初期スタートは発艦時にBGM開始されているので、BGM流すのはリスタート・カスタム時だけ
                BGM.play(BGM.STAGE1)
        elif stage == "2A":
            # 生物
            #pyxel.load("assets/graslay_dangeon22.pyxres", False, False, True, True)
            pyxel.image(1).load(0, 0, "assets/graslay2.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = False
            gcommon.draw_star = False
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/graslay2.pyxmap")
            MapData.loadMapAttribute("assets/graslay2.mapatr")
        elif stage == "2B":
            # 洞窟
            pyxel.image(1).load(0, 0, "assets/stage_cave.png")
            pyxel.image(2).load(0, 0, "assets/stage_cave-2.png")
            gcommon.sync_map_y = 2
            gcommon.long_map = True
            gcommon.draw_star = False
            gcommon.eshot_sync_scroll = True
            MapData.loadMapData(0, "assets/stage_cave.pyxmap")
            MapData.loadMapData(1, "assets/stage_caveb.pyxmap")
            MapData.loadMapAttribute("assets/stage_cave.mapatr")
            pyxel.tilemap(1).refimg = 1
        elif stage == "3B":
            # 倉庫
            pyxel.image(1).load(0, 0, "assets/stage_warehouse.png")
            pyxel.image(2).load(0, 0, "assets/stage_warehouse-2.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = True
            gcommon.draw_star = False
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0,
                                "assets/stage_warehouse0.pyxmap")  # 手前に見えるマップ
            MapData.loadMapData(2,
                                "assets/stage_warehouse1.pyxmap")  # 奥に見えるマップ
            MapData.loadMapData(5,
                                "assets/stage_warehousei.pyxmap")  # アイテム用マップ
            MapData.loadMapData(7, "assets/stage_warehouseb.pyxmap")  # 遠景
            pyxel.tilemap(0).refimg = 1
            pyxel.tilemap(2).refimg = 1
            pyxel.tilemap(7).refimg = 1  # background
            MapData.loadMapAttribute("assets/stage_warehouse.mapatr")
        elif stage == "3A":
            # 高速スクロール
            pyxel.image(1).load(0, 0, "assets/graslay3.png")
            gcommon.sync_map_y = 1
            gcommon.long_map = True
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            gcommon.breakableMapData = True
            MapData.loadMapData(0, "assets/graslay3-0.pyxmap")
            MapData.loadMapData(1, "assets/graslay3-1.pyxmap")
            MapData.loadMapData(2, "assets/graslay3b.pyxmap")
            MapData.loadMapAttribute("assets/graslay3.mapatr")
            pyxel.tilemap(1).refimg = 1
            pyxel.tilemap(2).refimg = 1
        elif stage == "3C":
            # 巨大戦艦
            pyxel.image(1).load(0, 0, "assets/stage_battleship.png")
            pyxel.image(2).load(0, 0, "assets/stage_battleship-2.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = True
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/stage_battleship.pyxmap")
            MapData.loadMapData(1, "assets/stage_battleship-2.pyxmap")
            MapData.loadMapAttribute("assets/stage_battleship.mapatr")
            MapData.loadMapAttribute2("assets/stage_battleship-2.mapatr")
            pyxel.tilemap(0).refimg = 1
            pyxel.tilemap(1).refimg = 2
        elif stage == "4A":
            # 遺跡
            pyxel.image(1).load(0, 0, "assets/graslay4.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = False
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/graslay4.pyxmap")
            MapData.loadMapData(1, "assets/graslay4b.pyxmap")
            MapData.loadMapAttribute("assets/graslay4.mapatr")
            pyxel.tilemap(1).refimg = 1
        elif stage == "4B":
            # 迷宮
            pyxel.image(1).load(0, 0, "assets/stage_labyrinth.png")
            pyxel.image(2).load(0, 0, "assets/stage_labyrinth2.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = True
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/stage_labyrinth.pyxmap")
            MapData.loadMapData(1, "assets/stage_labyrinth2.pyxmap")
            MapData.loadMapData(7, "assets/stage_labyrinthb.pyxmap")
            MapData.loadMapAttribute("assets/stage_labyrinth.mapatr")
            pyxel.tilemap(1).refimg = 1
            pyxel.tilemap(7).refimg = 1
        elif stage == "5A":
            # ファクトリー
            pyxel.image(1).load(0, 0, "assets/graslay_factory.png")
            pyxel.image(2).load(0, 0, "assets/graslay_factory-2.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = True
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/graslay_factory.pyxmap")
            MapData.loadMapData(1, "assets/graslay_factoryb.pyxmap")
            MapData.loadMapAttribute("assets/graslay_factory.mapatr")
            pyxel.tilemap(1).refimg = 1
        elif stage == "5B":
            # 火
            pyxel.image(1).load(0, 0, "assets/stage_fire.png")
            pyxel.image(2).load(0, 0, "assets/stage_fire2.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = True
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/stage_fire0.pyxmap")  # 基地
            MapData.loadMapData(2, "assets/stage_fire1.pyxmap")  # 火
            MapData.loadMapData(7, "assets/stage_fireb.pyxmap")  # 遠景?
            MapData.loadMapAttribute("assets/stage_fire.mapatr")
            pyxel.tilemap(0).refimg = 1
            pyxel.tilemap(2).refimg = 1
        elif stage == "6A":
            # 最終ステージA
            pyxel.image(1).load(0, 0, "assets/graslay_last.png")
            pyxel.image(2).load(0, 0, "assets/graslay_last-1.png")
            #pyxel.image(2).load(0,0,"assets/graslay_last-2.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = True
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/graslay_last.pyxmap")
            MapData.loadMapData(1, "assets/graslay_lastb.pyxmap")
            MapData.loadMapAttribute("assets/graslay_last.mapatr")
            pyxel.tilemap(1).refimg = 1
        elif stage == "6B":
            # 最終ステージB
            pyxel.image(1).load(0, 0, "assets/stage_enemybase.png")
            pyxel.image(2).load(0, 0, "assets/stage_enemybase-2.png")
            #pyxel.image(2).load(0,0,"assets/graslay_last-2.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = True
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            gcommon.breakableMapData = True
            gcommon.scrollController = ScrollController1(
                __class__.scrollTable6B)
            MapData.loadMapData(0, "assets/stage_enemybase.pyxmap")
            MapData.loadMapData(1, "assets/stage_enemybase-2.pyxmap")
            MapData.loadMapData(2, "assets/stage_enemybase-3.pyxmap")
            MapData.loadMapData(7, "assets/stage_enemybaseb.pyxmap")
            MapData.loadMapAttribute("assets/stage_enemybase.mapatr")
            pyxel.tilemap(1).refimg = 1
            pyxel.tilemap(2).refimg = 1
            pyxel.tilemap(4).refimg = 1
            pyxel.tilemap(7).refimg = 1
        elif stage == "B1":
            #pyxel.load("assets/graslay_vehicle01.pyxres", False, False, True, True)
            #pyxel.image(1).load(0,0,"assets/banana1.png")
            gcommon.sync_map_y = 0
            gcommon.long_map = False
            gcommon.draw_star = True
            gcommon.eshot_sync_scroll = False
            MapData.loadMapData(0, "assets/graslay1.pyxmap")
            MapData.loadMapData(1, "assets/graslay1b.pyxmap")
            MapData.loadMapAttribute("assets/graslay1.mapatr")
            pyxel.tilemap(1).refimg = 1
        #elif self.stage == 3:
        #	pyxel.image(1).load(0,0,"assets\gra-den3a.png")
        #	pyxel.image(2).load(0,0,"assets\gra-den3b.png")
        #	gcommon.draw_star = True


# bossRushScrollConteroller3A = [
#         [0, ScrollController1.LOOP_X, 64*8, 96*8],     # 0
#         [0, ScrollController1.SET_SCROLL, 2.0, 0.0],     # 1
# ]

# class InitStage3A(EnemyBase):
#     def __init__(self, t):
#         super(__class__, self).__init__()
#         pyxel.image(1).load(0,0,"assets/graslay3.png")
#         gcommon.sync_map_y = 0
#         gcommon.long_map = False
#         gcommon.draw_star = True
#         gcommon.eshot_sync_scroll = False
#         gcommon.breakableMapData = False
#         MapData.loadMapData(0, "assets/graslay3rush.pyxmap")
#         MapData.loadMapData(2, "assets/graslay3b.pyxmap")
#         MapData.loadMapAttribute("assets/graslay3.mapatr")
#         pyxel.tilemap(2).refimg = 1
#         gcommon.scrollController = ScrollController1(bossRushScrollConteroller3A)
#         ObjMgr.setDrawMap(MapDraw3rush())

#     def update(self):
#         gcommon.eventManager.nextEvent()
#         self.remove()

# class EndStage3A(EnemyBase):
#     def __init__(self, t):
#         super(__class__, self).__init__()
#         gcommon.scrollController = None
#         ObjMgr.setDrawMap(None)
#         gcommon.cur_scroll_x = 0.5
#         gcommon.cur_scroll_y = 0.0

#     def update(self):
#         gcommon.eventManager.nextEvent()
#         self.remove()

# class InitStage3B(EnemyBase):
#     def __init__(self, t):
#         super(__class__, self).__init__()
#         pyxel.image(1).load(0,0,"assets/stage_warehouse.png")
#         pyxel.image(2).load(0,0,"assets/stage_warehouse-2.png")
#         self.layer = gcommon.C_LAYER_UNDER_GRD
#         gcommon.sync_map_y = 0
#         gcommon.long_map = False
#         gcommon.draw_star = True
#         gcommon.eshot_sync_scroll = False
#         gcommon.breakableMapData = False
#         MapData.loadMapData(0, "assets/stage_warehouse-rush.pyxmap")    # 手前に見えるマップ
#         pyxel.tilemap(0).refimg = 1
#         ObjMgr.setDrawMap(None)
#         gcommon.cur_scroll_x = 0.0
#         gcommon.cur_scroll_y = 0.0
#         gcommon.map_x = 0
#         gcommon.map_y = 0
#         gcommon.debugPrint("InitStage3B")

#     def update(self):
#         if self.cnt < 90:
#             pass
#         else:
#             gcommon.eventManager.nextEvent()
#             self.remove()

#     def draw(self):
#         if self.state == 0:
#             x = math.pow(1 - (self.cnt/90.0), 3)
#             pyxel.bltm(x * 256, 4, 0, 40, 0, 32, 24, 3)
Пример #7
0
 def __init__(self, t):
     BGM.play(t[2])