Пример #1
0
 public override void Load(int clipStart, int clipEnd, int fps)
 {
     skd = Model.Tag as SkinningData;
     clipPlayer = new ClipPlayer(skd, fps);//ClipPlayer running at 24 frames/sec
     AnimationClip clip = skd.AnimationClips["Take 001"]; //Take name from the dude.fbx file
     clipPlayer.play(clip, clipStart, clipEnd, false);
     modelScale = 0.4f;
     enemyMatrix = Matrix.CreateScale(modelScale) * Matrix.CreateRotationY((float)MathHelper.Pi * 2) *
                        Matrix.CreateTranslation(Position);
     BoundingSphere scaledSphere;
     scaledSphere = BoundingSphere;
     boundingSphereScale = 0.30f;
     scaledSphere.Radius *= boundingSphereScale;
     BoundingSphere =
         new BoundingSphere(scaledSphere.Center, scaledSphere.Radius);
     // Set up the parameters
     SetupShaderParameters(PoseidonGame.contentManager, Model);
 }
Пример #2
0
        void playUpClip(int newLevel)
        {
            switch (newLevel)
            {
            case 2:
                clipPlayer.play(1, 9, false);
                break;

            case 3:
                clipPlayer.play(9, 19, false);
                break;

            case 4:
                clipPlayer.play(19, 29, false);
                break;

            case 5:
                clipPlayer.play(29, 39, false);
                break;

            default:
                break;
            }
        }
Пример #3
0
        public OtherPlayer(float x, float y, float z, Int32 identity, Int16 mo, float xro, float yro)
        {
            model = mo;
            Console.WriteLine(mo);
            position.X = x;
            position.Y = y;
            position.Z = z;
            id         = identity;
            alive      = true;
            Console.WriteLine(mo.ToString());
            if (model == Constants.HAMPUS)
            {
                mod           = Globals.hampus;
                clipPlayer    = new ClipPlayer(Globals.hampusSkinningData, 60);
                animationClip = Globals.hampusSkinningData.AnimationClips["Take 001"];
            }
            else if (model == Constants.RASMUS)
            {
                mod           = Globals.rasmus;
                clipPlayer    = new ClipPlayer(Globals.rasmusSkinningData, 60);
                animationClip = Globals.rasmusSkinningData.AnimationClips["Take 001"];
            }
            else if (model == Constants.VALTER)
            {
                mod           = Globals.valter;
                clipPlayer    = new ClipPlayer(Globals.valterSkinningData, 60);
                animationClip = Globals.valterSkinningData.AnimationClips["Take 001"];
            }
            else if (model == Constants.AXEL)
            {
                mod           = Globals.axel;
                clipPlayer    = new ClipPlayer(Globals.axelSkinningData, 60);
                animationClip = Globals.axelSkinningData.AnimationClips["Take 001"];
            }

            Globals.s += identity;

            xr = xro;
            yr = yro;
            Globals.players[identity] = this;

            //idle
            clipPlayer.play(animationClip, 570, 600, true);
        }
Пример #4
0
        public void Load(int clipStart, int clipEnd, int fpsRate)
        {
            skd = Model.Tag as SkinningData;
            clipPlayer = new ClipPlayer(skd, fpsRate);//ClipPlayer running at 24 frames/sec
            AnimationClip clip = skd.AnimationClips["Take 001"]; //Take name from the dude.fbx file
            clipPlayer.play(clip, clipStart, clipEnd, true);
            fishMatrix = Matrix.CreateScale(1.0f) * Matrix.CreateRotationY((float)MathHelper.Pi * 2) *
                               Matrix.CreateTranslation(Position);
            BoundingSphere scaledSphere;
            scaledSphere = BoundingSphere;

            float scale = 1.0f;
            if (Name.Contains("turtle")) scale = 0.4f;
            if (Name.Contains("dolphin")) scale = 0.25f;
            if (Name.Contains("manetee")) scale = 0.4f;
            if (Name.Contains("sting ray")) scale = 0.5f;
            if (Name.Contains("orca")) scale = 0.5f;
            if (Name.Contains("seal")) scale = 0.5f;
            if (Name.Contains("shark")) scale = 0.5f;
            if (Name.Contains("Maui")) scale = 0.5f;
            if (Name.Contains("Meiolania")) scale = 0.5f;
            if (Name.Contains("penguin")) scale = 2.0f;
            if (isBigBoss)
            {
                //scale *= 2.0f;
                maxHealth = 5000;
                health = 5000;
            }
            scaledSphere.Radius *= scale;

            BoundingSphere =
                new BoundingSphere(scaledSphere.Center, scaledSphere.Radius);

            // Set up the parameters
            SetupShaderParameters(PoseidonGame.contentManager, Model);
            EffectHelpers.GetEffectConfiguration(ref fogColor, ref ambientColor, ref diffuseColor, ref specularColor);
        }
Пример #5
0
        public virtual void Load(int clipStart, int clipEnd, int fps)
        {
            skd = Model.Tag as SkinningData;
            clipPlayer = new ClipPlayer(skd, fps);//ClipPlayer running at 24 frames/sec
            AnimationClip clip = skd.AnimationClips["Take 001"]; //Take name from the dude.fbx file
            clipPlayer.play(clip, clipStart, clipEnd, true);
            enemyMatrix = Matrix.CreateScale(0.1f) * Matrix.CreateRotationY((float)MathHelper.Pi * 2) *
                               Matrix.CreateTranslation(Position);
            BoundingSphere scaledSphere;
            scaledSphere = BoundingSphere;
            float scale = 1.0f;
            if (Name.Contains("Shooting Enemy")) scale = 0.05f;
            if (Name.Contains("Combat Enemy")) scale = 0.06f;
            scaledSphere.Radius *= scale;
            BoundingSphere =
                new BoundingSphere(scaledSphere.Center, scaledSphere.Radius);
            //isBigBoss = true;
            //random = new Random();
            //health = 1000;
            //maxHealth = 1000;
            //perceptionRadius = GameConstants.BossPerceptionRadius;
            //experienceReward = 400; //3000

            // Set up the parameters
            SetupShaderParameters(PoseidonGame.contentManager, Model);
        }
Пример #6
0
        //public BoundingBox boundingBox;
        public void LoadContent(ContentManager content, string modelname, bool isAnimated, int clipStart, int clipEnd, int fpsRate)
        {
            if (HydroBot.gameMode == GameMode.MainGame)
            {
                orientation = (float)random.Next(0, 629) / 100;
                if (!isAnimated)
                    modelScale = (float)random.Next(5, 11) / 10;
                else modelScale = random.Next(4, 7);
            }
            else if (HydroBot.gameMode == GameMode.ShipWreck)
            {
                modelScale = 1.0f;
            }
            Model = content.Load<Model>(modelname);
            Position = Vector3.Down;
            BoundingSphere = CalculateBoundingSphere();

            BoundingSphere scaledSphere;
            scaledSphere = BoundingSphere;

            boundingSphereScale = modelScale;
            if (HydroBot.gameMode == GameMode.ShipWreck)
                scaledSphere.Radius *= GameConstants.ShipWreckBoundingSphereFactor;
            else scaledSphere.Radius *= boundingSphereScale;
            BoundingSphere =
                new BoundingSphere(scaledSphere.Center, scaledSphere.Radius);

            this.isAnimated = isAnimated;

            if (isAnimated)
            {
                skd = Model.Tag as SkinningData;
                clipPlayer = new ClipPlayer(skd, fpsRate);//ClipPlayer running at 24 frames/sec
                AnimationClip clip = skd.AnimationClips["Take 001"]; //Take name from the dude.fbx file
                clipPlayer.play(clip, clipStart, clipEnd, true);
                fishMatrix = Matrix.CreateScale(modelScale) * Matrix.CreateRotationY((float)MathHelper.Pi * 2) *
                                   Matrix.CreateTranslation(Position);
            }

            // Set up the parameters
            //SetupShaderParameters(content, Model);
        }