예제 #1
0
        //-------------------------------------------------------------------------
        public void onFingerTouch(Vector2 fire_goal_position)
        {
            CRenderLevel level = mScene.getLevel();

            if (level == null)
            {
                return;
            }

            bool level_isrun = level.isNormal();

            if (!level_isrun)
            {
                return;
            }

            if (getPlayerGold() < mTurretRate)
            {
                goldNotEnough();
                return;
            }

            if (mfTotalSecond - mfLastTouchSecond < mfHighFrequencyTimeSpan)
            {
                miHighFrequencyCount++;
            }
            else
            {
                miHighFrequencyCount = 0;
            }

            if (checkWhetherFire())
            {
                int bullet_objid = genBulletObjId(1);
                doLocalFire(fire_goal_position, bullet_objid, CBulletConstant.ManualSpeed);

                mScene.getProtocol().c2sManualFire(mPlayer.et_player_rpcid, bullet_objid,
                                                   mTurretAngle, mTurretRate, _getLockedFishIdFromLockedBuffer());
            }

            mfLastTouchSecond = mfTotalSecond;
        }