Exemplo n.º 1
0
            public void ShootHealth(Vector where)
            {
                var b = new HealthBonus(where);

                b.onDeath += b.Recycle;
                BulletAdder(b);
            }
        public void Using()
        {
            var bonus = new HealthBonus(new Vector(5, 5), 10);
            var game  = new Game();

            bonus.Use(game);
            Assert.True(game.Player.Health == 20);
        }
Exemplo n.º 3
0
        private void GenerateBonus(Vector position)
        {
            Bonus bonus = new HealthBonus(position, 333);

            //Bonus bonus = new RocketsBonus(position, 2);

            Logger.Log(string.Format("Add bonus {0} in position {1}", bonus, position));

            AddGameObject(bonus);
        }
Exemplo n.º 4
0
 private void MakeThisObjectSingleton()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 5
0
    private void Destroyed()
    {
        if (explosionPrefab != null)
        {
            Explosion.Create(transform.position, explosionPrefab);
        }

        if (Random.Range(0, 100) < 50)
        {
            HealthBonus.Create(transform.position);
        }

        ScoreLabel.Score += scorePoint;
    }
 public void Creation()
 {
     var bonus = new HealthBonus(new Vector(5, 5), 10);
 }
Exemplo n.º 7
0
    public void GetRandomCollectible(EntityCommandBuffer ecb, Entity entity, CanBePickedUp c, HealthBonus hb)
    {
        if (collectiblesList.Count <= 0)
        {
            return;
        }

        var colEntry = collectiblesList[RandomRogue.Next(0, collectiblesList.Count)];

        c.appearance.sprite = GlobalGraphicsSettings.ascii ? colEntry.spriteAscii : colEntry.spriteGraphics;
        c.description       = colEntry.description;
        c.name = colEntry.name;

        ecb.SetComponent(entity, c);

        if (colEntry.healthBonus != 0)
        {
            hb.healthAdded = colEntry.healthBonus;

            //TODO: fix this
            //entityManager.SetComponentData(entity, hb);
            ecb.SetComponent(entity, hb);
        }
    }