예제 #1
0
파일: Game1.cs 프로젝트: Felle321/TitanBenk
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            drawBatch   = new DrawBatch();
            pixel       = Content.Load <Texture2D>("pixel");
            fader       = Content.Load <Texture2D>("Fader");
            fontDebug   = Content.Load <SpriteFont>("debug");
            Terrain.LoadContent(Content);
            Projectile.LoadContent(Content);
            EffectObject.LoadContent(Content);
            Particle.LoadContent(Content);
            Ability.LoadContent(Content);
            GUI.LoadContent(Content);
            Item.LoadContent(Content);
            FXDepthMask            = Content.Load <Effect>("Shaders\\FXDepthMask");
            FXApplyShadowsToLights = Content.Load <Effect>("Shaders\\FXApplyShadowsToLight");

            Rig.LoadContent(Content);
            RigAnimation.LoadContent(Content);
            RigLimbDrawer.LoadContent(GraphicsDevice, Content);

            agents.Add(new Player(new Vector2(100)));
            agents.Add(new Agent(new Vector2(40), "Könet", Agent.Tag.Enemy, CharacterStats.Default));
            agents.Add(new Agent(new Vector2(60), "Gypsit", Agent.Tag.Enemy, CharacterStats.Default));

            agents[1].collider.SetActiveAreaCircle(0, 3.14f);

            TileObject.LoadContent(Content);

            for (int i = 0; i < 100; i++)
            {
                terrain.TryCreateTileObject(new Tree(new Point(random.Next(terrain.size.X), random.Next(terrain.size.Y))));
            }
        }
예제 #2
0
        public static RigAnimation GetAnimationFromData(string data)
        {
            string[] datas = data.Split(':');
            string[] animationVariables = datas[0].Split(' ');

            RigAnimation animation = new RigAnimation((Rig.Type)Enum.Parse(typeof(Rig.Type), animationVariables[0]), animationVariables[1], bool.Parse(animationVariables[2]));

            animation.length = float.Parse(animationVariables[3]);
            animation.speed  = float.Parse(animationVariables[4]);

            #region Priorities
            string[] priorities = datas[1].Split(' ');

            for (int i = 0; i < priorities.Length; i += 2)
            {
                if (priorities.Length - 1 > i + 1)
                {
                    animation.priorities.Add(priorities[i], float.Parse(priorities[i + 1]));
                }
            }
            #endregion

            #region KeyFrames
            string[] keyframes = datas[2].Split(';');
            for (int i = 0; i < keyframes.Length; i++)
            {
                if (keyframes[i] != null && keyframes[i] != "")
                {
                    animation.keyFrames.Add(KeyFrame.GetKeyFrameFromData(keyframes[i]));
                }
            }
            #endregion

            return(animation);
        }
예제 #3
0
 internal void AddAnimation(string name)
 {
     if (activeAnimations.ContainsKey(name))
     {
         activeAnimations.Remove(name);
     }
     activeAnimations.Add(name, RigAnimation.GetAnimationFromLibrary(type, name));
 }
예제 #4
0
        internal RigAnimation Duplicate()
        {
            RigAnimation ret = new RigAnimation(rigType, name, loop);

            ret.finished   = finished;
            ret.frameCount = frameCount;
            ret.keyFrames  = keyFrames;
            ret.length     = length;
            ret.priorities = priorities;
            ret.speed      = speed;

            return(ret);
        }
예제 #5
0
 static void AddAnimationToLibrary(RigAnimation animation)
 {
     animationLibrary[animation.rigType].Add(animation.name, animation);
 }