예제 #1
0
        public void SetSceneType(FishDefine.enSceneType SceneType)
        {
            if (SceneType == FishDefine.enSceneType.SceneTypeCount)
            {
                return;
            }

            //if (SceneType == m_SceneType)
            //    return;
            //MessageBox(0,"","",0);

            m_SceneType = SceneType;

            ostringstream ostr = new ostringstream();

            ostr = ostr + "bg_game_" + (int)SceneType;

            m_imgBackground0 = Root.instance().imageset_manager().imageset(ostr.str()).image("bg");
            m_imgBackground1 = null;

            m_sprTideWater.set_position(new Point(1272 - 20, 0));
            m_sprTideWater.set_visible(false);

            if (m_BackSound[m_cbSceneSound] != null)
            {
                m_BackSound[m_cbSceneSound].play(true, false);
            }

            m_cbSceneSoundOld = m_cbSceneSound;
        }
예제 #2
0
        public CBackgroundLayer()
        {
            this.m_SceneType      = FishDefine.enSceneType.SceneTypeCount;
            this.m_imgBackground0 = null;
            this.m_imgBackground1 = null;
            m_sprTideWater        = new Sprite();
            //    m_sprTideWater = new Sprite(Root::instance()->imageset_manager()->imageset("ui_game")->image("tide_water"));

            m_sprTideWater.set_hot(new Point(0, 0));
            m_sprTideWater.set_position(new Point(1272 - 20, 0));
            m_sprTideWater.set_visible(false);
            add_child(m_sprTideWater);


            for (int i = 80; i < 90; i++)
            {
                try
                {
                    m_BackSound[i - 80] = Root.instance().music_manager().sound_instance(i);
                }
                catch
                {
                    m_BackSound[i - 80] = null;
                }
            }

            m_IsSceneing      = 0;
            m_cbSceneSound    = 0;
            m_cbSceneSoundOld = 0;
        }
예제 #3
0
        public void ChangeSceneType(FishDefine.enSceneType SceneType)
        {
            if (SceneType == m_SceneType)
            {
                return;
            }

            if (m_BackSound[m_cbSceneSoundOld] != null)
            {
                m_BackSound[m_cbSceneSoundOld].stop();
            }

            m_cbSceneSoundOld = m_cbSceneSound;

            try
            {
                Sound_Instance pSound = Root.instance().sound_manager().sound_instance(4);
                pSound.play(false, true);
            }
            catch
            {
            }

            m_SceneType  = SceneType;
            m_IsSceneing = 1;

            ostringstream ostr = new ostringstream();

            int nSide = 1;

            Point ptBegin = (nSide == 0) ? new Point(-263, 0) : new Point(1280 + 263, 0);
            Point ptEnd   = (nSide == 0) ? new Point(1272 - 20, 0) : new Point(-283, 0);

            ostr.str("");
            ostr = ostr + "tide_water_" + nSide;

            m_sprTideWater.set_display_image(Root.instance().imageset_manager().imageset("ui_game").image(ostr.str()));
            m_sprTideWater.set_position(ptBegin);
            m_sprTideWater.set_visible(true);

            ostr.str("");
            ostr             = ostr + "bg_game_" + (int)SceneType;
            m_imgBackground1 = Root.instance().imageset_manager().imageset(ostr.str()).image("bg");

            GameControls.XLBE.Action actWater = new Action_Sequence(new Action_Delay(4), new Action_Move_To(4.4135, ptEnd), new Action_Func(ChangeSceneEnd), null);
            m_sprTideWater.run_action(actWater);
        }