예제 #1
0
        public void SetupAnimations()
        {
            collectorAnim             = new AnimSet(CollectorAnimations());
            collectorAnim.frameOffset = new Vector2(0, 135);
            collectorAnim.Play((int)States.Intro);


            Animation[] portalAnimations =
            {
                new Animation(0, 47, false)
            };

            portalAnim = new AnimSprite("collector_portal", new Point(570, 200), portalAnimations);
            portalAnim.frameOffset.Y += 620;
            portalAnim.Play(0);


            Animation[] poofAnimations =
            {
                new Animation(0, 30, false)
            };

            poofAnim         = new AnimSprite("collector_poof", new Point(200, 150), poofAnimations);
            poofAnim.playing = false;


            Animation[] explodeAnimations =
            {
                new Animation(0, 48, false)
            };

            explodeAnim                = new AnimSprite("collector_explosion_particles", new Point(500, 500), explodeAnimations);
            explodeAnim.playing        = false;
            explodeAnim.frameOffset.Y += 100;
        }
예제 #2
0
        public void Play(int sheet)
        {
            this.sheet = sheet;

            Animation[] animation = new Animation[] {
                new Animation(0, spritesheets[sheet].totalFrames, spritesheets[sheet].loop)
            };

            Vector2 pos = Vector2.Zero;

            if (anim != null)
            {
                pos = anim.position;
            }

            anim              = new AnimSprite(spritesheets[sheet].sheet, spritesheets[sheet].frameSize, animation, spritesheets[sheet].sprite);
            anim.frameOffset += frameOffset;
            anim.SetFrame(0);
            anim.position = pos;

            if (spritesheets[sheet].autoplay)
            {
                anim.Play(0);
            }
        }
예제 #3
0
        protected void SetupAnimations()
        {
            Animation[] pointerAnimations =
            {
                new Animation((int)Pointers.Alert,  6, false,  (int)Pointers.Idle),
                new Animation((int)Pointers.Exit,  14, false),
                new Animation((int)Pointers.Enter, 43, false,  (int)Pointers.Idle),
                new Animation((int)Pointers.Idle,  1),
            };
            pointerAnim = new AnimSprite("user_pointer", new Point(70, 70), pointerAnimations);
            pointerAnim.Play((int)Pointers.Enter);

            Animation[] pointsAnimations =
            {
                new Animation(0, 50),
                new Animation(1, 50)
            };
            pointsAnim = new AnimSprite("user_points", new Point(70, 70), pointsAnimations);
            pointsAnim.SetFrame(26);

            Animation[] stateAnimations =
            {
                new Animation((int)States.Pinch,      8),
                new Animation((int)States.BloatStart,  4,false,  (int)States.Bloat),
                new Animation((int)States.BloatEnd,    4,false,  (int)States.Idle),
                new Animation((int)States.Bloat,      8),
                new Animation((int)States.PinchStart,  4,false,  (int)States.Pinch),
                new Animation((int)States.PinchEnd,    4,false,  (int)States.Idle),
                new Animation((int)States.Idle,       1),
            };
            stateAnim = new AnimSprite("user_bloat_pinch", new Point(70, 70), stateAnimations);
            stateAnim.Play((int)States.Idle);
        }
예제 #4
0
        public void MergeWith(Collector other)
        {
            poofAnim.Play(0);
            Audio.Play("collector.merge", display);

            OrderedDictionary o = new OrderedDictionary();

            o.Add("team_1", id);
            o.Add("team_2", other.id);
            EventManager.Emit("collector:merge", o);

            capacity      += (int)(other.capacity * 0.5);
            collected     += (int)(other.collected * 0.5);
            collectRadius += (int)(other.collectRadius * 0.5f);
            targetScale   += (other.scale * 0.3f);
            numCollectors += other.numCollectors;

            foreach (User u in other.users)
            {
                u.collector = this;
                users.Add(u);
            }

            health = 100;

            TeamColour.Put(other.teamColour);
            CollectorManager.Remove(other);
        }
예제 #5
0
파일: Enemy.cs 프로젝트: FluxTheGame/engine
        public void Die()
        {
            Audio.Play("enemy.death", display);

            isDying = true;
            explosion.Play(0);
            explosion.WhenFinished(() =>
            {
                EnemyManager.Remove(this);
            });
        }
예제 #6
0
        public void PortalDie()
        {
            if (!isDying)
            {
                Die();

                portalAnim.WhenFinished(() => {
                    TeamColour.Put(teamColour);
                    CollectorManager.Remove(this);
                });

                collectorAnim.Play((int)States.Outro1 + damage);
                portalAnim.Play(0);
            }
        }
예제 #7
0
        public void ExplodeDie()
        {
            if (!isDying)
            {
                Die();

                explodeAnim.WhenFinished(() => {
                    TeamColour.Put(teamColour);
                    CollectorManager.Remove(this);
                });

                Audio.Play("collector.bass", 4);
                collectorAnim.Play((int)States.Exploding);
                collectorAnim.frameOffset = new Vector2(50, 137);
                explodeAnim.Play(0);
            }
        }
예제 #8
0
 public void Alert()
 {
     pointerAnim.Play((int)Pointers.Alert);
 }
예제 #9
0
 public void BloatStart()
 {
     action = (int)Actions.Bloating;
     stateAnim.Play((int)States.BloatStart);
 }