Esempio n. 1
0
 public void RemovePointSprite(PointSprite ps) {this.pointSprites.Remove(ps);}
Esempio n. 2
0
        private void updateTarget(GameTime gameTime)
        {
            foreach (Target t in Targets)
            {
                switch (t.state)
                {
                    case Target.State.Spawning:
                        if (t.SpawnInAnim())
                            t.state = Target.State.Moving;
                        break;

                    case Target.State.DeSpawning:
                        if (t.SpawnOutAnim())
                            TargetsToDelete.Add(t);
                        break;

                    case Target.State.Dying:
                        if (t.DeathAnim())
                            TargetsToDelete.Add(t);
                        break;
                }

                if (t.MaxTimeOnScreen < t.CurrentTimeOnScreen || this.round.RoundIsOver)
                {
                    switch (t.state)
                    {
                        case Target.State.Moving:
                        case Target.State.SpeedDown:
                        case Target.State.SpeedUp:
                            t.state = Target.State.DeSpawning;
                            break;
                    }
                }

                else
                {
                    if (this.glub.State == GlubState.Thrown && this.glub.Hitbox.Intersects(t.Hitbox))
                    {
                        PointSprite ps;
                        switch (t.state)
                        {
                            case Target.State.Moving:
                            case Target.State.SpeedDown:
                            case Target.State.SpeedUp:
                            case Target.State.DeSpawning:
                                if(t is Basic_Target) { ps = new PointSprite(this.Game, true); }
                                else { ps = new PointSprite(this.Game, false); }

                                ps.Initialize();
                                ps.Location = new Vector2(t.LocationRect.X + 25, t.LocationRect.Y - 10);
                                ps.SetStartPos();

                                this.AddPointSprite(ps);

                                t.PlayHitSound();

                                this.round.Points += t.pointValue;

                                if (this.glub.HasStrongBuff == false)
                                    this.glub.ThrownToSeeking();

                                this.glub.HasBounced = true;
                                t.state = Target.State.Dying;
                                t.Speed = 10;
                                t.color = new Color(230, 230, 230, 230);
                                break;

                            default:
                                break;
                        }
                    }
                }

                checkCollision(t);
            }
        }
Esempio n. 3
0
 public void AddPointSprite(PointSprite ps) {this.pointSprites.Add(ps);}