Exemplo n.º 1
0
Arquivo: TCell.cs Projeto: Wydra/LD24
        public override void Update(SceneGraph graph)
        {
            base.Update(graph);

            ticks = ticks % 120;
            if (ticks == 0)
            {
                 Velocity = RNG.RandomUnitVector();
            }

            ticks++;
        }
Exemplo n.º 2
0
 public override void Update(SceneGraph graph)
 {
 }
Exemplo n.º 3
0
Arquivo: Cell.cs Projeto: Wydra/LD24
        public override void Update(SceneGraph graph)
        {
            base.Update(graph);

            if (State == CellState.Dead)
            {
                if (DeathCounter > 0)
                {
                    DeathCounter--;
                    Tint = new Color(Tint.R, Tint.G, Tint.B, DeathCounter);
                }
                else
                {
                    graph.Remove(this);
                }
            }
        }
Exemplo n.º 4
0
Arquivo: Sprite.cs Projeto: Wydra/LD24
        public virtual void Update(SceneGraph graph)
        {
            if (Velocity != Vector2.Zero)
            {
                Vector2 newPosition = Position;

                newPosition.X += Velocity.X * Speed;
                newPosition.Y += Velocity.Y * Speed;
                Position = newPosition;
            }

            if (IsAnimating && Animation != null)
            {
                Animation.Update();
                DrawBounds = Animation.CurrentFrameRect;
                //DrawSize = _Animations[CurrentAnimation].CurrentFrameRect;
            }
        }
Exemplo n.º 5
0
Arquivo: Virus.cs Projeto: Wydra/LD24
        private void BirthChild(SceneGraph graph)
        {
            if (Energy >= GameStats.ChildEnergyCost)
            {
                if (!birthSoundPlayed)
                {
                    SoundManager.PlaySound(GameAssets.BirthSound, Position, 1F);
                    birthSoundPlayed = true;
                }

                Virus childVirus = Virus.Build();
                childVirus.VirusMode = Mode.Infecting;
                childVirus.InfectedCell = this.InfectedCell;

                Vector2 childPosition = InfectedCell.Position;
                Vector2 offset = GetRandomOffsetWithinBounds(InfectedCell.DrawBounds);

                childVirus.Position = InfectedCell.Position + offset;

                graph.Add(childVirus);
                Energy = 0;
            }
        }
Exemplo n.º 6
0
Arquivo: Virus.cs Projeto: Wydra/LD24
        public override void Update(SceneGraph graph)
        {
            birthSoundPlayed = false;
            this.Speed = GameStats.VirusSpeed;

            base.Update(graph);

            if (VirusMode == Mode.Free)
            {
                if (Velocity != Vector2.Zero)
                {
                    Rotate();
                    if (IsPlayer)
                    {
                        ApplyFriction();
                    }
                }
            }
            else if (VirusMode == Mode.Infecting)
            {
                ticks++;
                if (ticks % 100 == 0)
                {
                    ticks = 0;
                    DrainEnergy();
                    BirthChild(graph);
                    Scatter();
                }
            }
            else if (VirusMode == Mode.Dead)
            {
                if (DeathCounter > 0)
                {
                    DeathCounter--;
                    Tint = new Color(Tint.R, Tint.G, Tint.B, DeathCounter);
                }
                else
                {
                    graph.Remove(this);
                }
            }

            if (IsImmune)
            {
                ImmunityTicks++;

                if (ImmunityTicks >= ImmunityCounter)
                {
                    IsImmune = false;
                    this.Tint = Color.White;
                }
                else
                {
                    this.Tint = Color.Red;
                }
            }
        }
Exemplo n.º 7
0
        public void Initialize()
        {
            SceneGraph = new SceneGraph(Map, Camera);

            DebugHud = new DebugHud(new Vector2(16, 16), GameAssets.FontArial, Color.Black, Color.Black, Color.Black);

            EvoModal = EvolutionModal.Build();

            SeedLevel(Map);

            SoundManager.PlayMusic();
        }