//------------------------------------------------------------------------- public void dieByFullBomb(EbVector3 dest_pos) { if (mIsDie) { return; } mNotNeedDestroyParticle = true; mISpriteFish.setTrigger(false); mISpriteFish.playRotationAnimation(); mSpriteFreeFromTimeFactor = true; mMassEntity.setRoute(RouteHelper.buildLineRoute(mMassEntity.Position, dest_pos)); float speed = mMassEntity.Position.getDistance(dest_pos) / mSecondsSinceFullScreenBomb; mMassEntity.setSpeed(speed); setSurvivalTime(mSecondsSinceFullScreenBomb); signDie(); }
//------------------------------------------------------------------------- public void create(int fish_vibid, int fish_objid) { mFishData = EbDataMgr.Instance.getData <TbDataFish>(fish_vibid); mFishObjId = fish_objid; mSpeed = mFishData.getSpeed(); mFishType = (TbDataFish.FishType)mFishData.Type; mMassEntity = new MassEntity(); mMassEntity.setSpeed(mSpeed); mFishCollider = mScene.getColliderMgr().newFishCollider(0, 0, 80, 80, this);//读取vib配置 update(0); }
//------------------------------------------------------------------------- public void create(int fish_vib_id, int fish_objid) { mVibFish = EbDataMgr.Instance.getData <TbDataFish>(fish_vib_id); mFishObjId = fish_objid; mISpriteFish = mScene.getSpriteFishFactory().buildSpriteFish(this, fish_vib_id); mMassEntity = new MassEntity(); mMassEntity.setSpeed(mVibFish.getSpeed()); mISpriteFish.setDirection(0); mFishParticleMgr = new FishParticleMgr(mScene, this, fish_vib_id, mISpriteFish); mFishParticleMgr.fishBorn(); mFishParticleMgr.fishMoving(); }
//------------------------------------------------------------------------- public void setSpeed(float speed) { mMassEntity.setSpeed(speed); }