Exemplo n.º 1
0
        public override void Update()
        {
            base.Update();
            if (duration <= 0)
            {
                return;
            }
            pos            += direction * speed * elapsed;
            texturerotation = (float)Math.Atan2(direction.Y, direction.X);

            if (Collision(pos, level))
            {
                duration = 0;
                BloodParticle p = new BloodParticle(x, y, particlecolor);
                for (int i = 0; i < 50; i++)
                {
                    level.AddEntity(p);
                }
            }
            else
            {
                x = (int)pos.X;
                y = (int)pos.Y;
            }
        }
Exemplo n.º 2
0
 public void StartFirstRound()
 {
     currentScoresManager.AddNinjas(participatingNinjas);
     BloodParticle.DestroyAll();
     pregameManger.End();
     StartRound();
 }
Exemplo n.º 3
0
    public override void OnDamage(int damage, Vector2 hitPoint, Vector2 normal)
    {
        rigid.AddForce(-normal * damage * 2, ForceMode2D.Impulse);
        anim.SetHit();
        base.OnDamage(damage, hitPoint, normal);

        BloodParticle bp = PoolManager.GetItem <BloodParticle>();

        bp.SetRotation(normal);
        bp.SetParticleColor(hitColor);
        bp.Play(hitPoint);
    }
Exemplo n.º 4
0
    public virtual void OnDamage(int damage, Vector2 hitPoint, Vector2 normal, float power = 0)
    {
        // 피격 파티클은 여기서 재생
        BloodParticle hitParticle = PoolManager.GetItem <BloodParticle>();

        hitParticle.SetParticleColor(hitColor);
        hitParticle.SetRotation(normal);
        hitParticle.Play(hitPoint);

        currentHP -= damage;
        if (currentHP <= 0)
        {
            OnDie();
        }
    }
Exemplo n.º 5
0
    public void GameComplete()
    {
        if (MatchFinished != null)
        {
            MatchFinished();
        }

        RopeController.DestroyAllRopes();

        ninjaBodies = ninjaPicker.GetBodies(4);

        GameState = State.PlayerScreen;
        BloodParticle.DestroyAll();
        currentLevel.gameObject.SetActive(false);
        participatingNinjas.Clear();
    }