Esempio n. 1
0
    public override void Shoot()
    {
        BulletGroup bullet = Instantiate(bulletGroup, transform.position, transform.rotation);

        bullet.GetComponent <BulletGroup>().direction = Vector3.up;
        bullet.SetShooter(gameObject);
    }
Esempio n. 2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var job = new BulletGroup
            {
                DeltaTime = Time.deltaTime
            };

            return(job.Schedule(this, inputDeps));
        }
Esempio n. 3
0
 public BulletSpawner()
     : base()
 {
     SpawnTarget    = new BulletGroup(new Utilities.RectangleF());
     HowOften       = -1;
     LifeTime       = 0;
     bufferTime     = 0;
     BulletsSpawned = 0;
 }
Esempio n. 4
0
 public BulletSpawner(SpawnBullet spawningDelegate, BulletGroup spawnTarget, float howOften)
     : base()
 {
     _spawningDelegate = spawningDelegate;
     SpawnTarget       = spawnTarget;
     HowOften          = howOften;
     LifeTime          = 0;
     bufferTime        = 0;
     BulletsSpawned    = 0;
 }
Esempio n. 5
0
 public Player(Texture2D texture, Color color, Vector2 position, float radius, Keybindings bindings, RectangleF bulletDestroyBounds, float movementVelocityUnfocused, float movementVelocityFocused, float angularVelocity, float scale = DefaultScale, float rotation = DefaultRotation)
     : base(texture, position, radius, scale, rotation, false)
 {
     Bullets          = new BulletGroup(bulletDestroyBounds);
     BulletSpawners   = new List <BulletSpawner>();
     _angularVelocity = angularVelocity;
     Bindings         = bindings;
     _movementVelocityUnfocusedSize = movementVelocityUnfocused;
     _movementVelocityFocusedSize   = movementVelocityFocused;
     Sprite.Color = color;
 }
Esempio n. 6
0
    public override void Shoot()
    {
        if (isPlayer)
        {
            playerPos = new Vector3(0, 0, 0);
        }
        BulletGroup bullet = Instantiate(bulletGroup, transform.position + playerPos, transform.rotation);

        if (isPlayer)
        {
            bullet.GetComponent <BulletGroup>().direction = new Vector3(-Mathf.Sin(transform.rotation.eulerAngles.z * Mathf.Deg2Rad), Mathf.Cos(transform.rotation.eulerAngles.z * Mathf.Deg2Rad), 0);
        }
        else
        {
            bullet.GetComponent <BulletGroup>().direction = playerPos;
        }
        bullet.SetShooter(gameObject);
    }
Esempio n. 7
0
    private void Shoot()
    {
        Vector3 bulletStartPos = new Vector3(transform.position.x + bulletPosX, transform.position.y + bulletPosY, 0);

        if (Input.GetKeyDown(KeyCode.J))
        {
            shootSound.PlayOneShot(shootSound.clip, 0.50f);
            Instantiate(bullet, bulletStartPos, Quaternion.identity, BulletGroup.Get().transform);
            if (GameManager.Get().GetRange() >= 2)
            {
                for (int i = 1; i < GameManager.Get().GetRange(); i++)
                {
                    Vector3 bulletRangePos = new Vector3(i * bulletSpacing, 0);
                    Instantiate(bullet, (bulletStartPos + bulletRangePos), Quaternion.identity, BulletGroup.Get().transform);
                    Instantiate(bullet, (bulletStartPos - bulletRangePos), Quaternion.identity, BulletGroup.Get().transform);
                }
            }
        }
        if (Input.GetKeyDown(KeyCode.Space) && GameManager.Get().BombOK())
        {
            Instantiate(bomb, this.transform.position, Quaternion.identity);
        }
    }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     Rigidbody   = GetComponent <Rigidbody>();
     BulletGroup = GetComponent <BulletGroup>();
 }
Esempio n. 9
0
 private void Start()
 {
     rb = GetComponent <Rigidbody>();
     bg = GetComponent <BulletGroup>();
 }