public void NormalShoot(List <Sprite> sprites) { var bullet = BulletManager.GetBullet(new Vector2(0, 1), new Vector2(Position.X - 50, Position.Y + 40), 3, this, (int)Config.TrackStyle.NormalWithBias, 1, (int)Config.BulletStyle.Bullet3); var bullet1 = BulletManager.GetBullet(new Vector2(0, 1), new Vector2(Position.X - 20, Position.Y + 40), 3, this, (int)Config.TrackStyle.NormalWithBias, 1, (int)Config.BulletStyle.Bullet3); var bullet2 = BulletManager.GetBullet(new Vector2(0, 1), new Vector2(Position.X + 20, Position.Y + 40), 3, this, (int)Config.TrackStyle.NormalWithBias, 1, (int)Config.BulletStyle.Bullet3); var bullet3 = BulletManager.GetBullet(new Vector2(0, 1), new Vector2(Position.X + 50, Position.Y + 40), 3, this, (int)Config.TrackStyle.NormalWithBias, 1, (int)Config.BulletStyle.Bullet3); if (Power == 0) { Power = bullet.Power; } sprites.Add(bullet); sprites.Add(bullet1); sprites.Add(bullet2); sprites.Add(bullet3); }
private void FireBullet() { if (Time.frameCount % 60 == 0) { bulletManager.GetBullet(BulletType.PlayerBullet, gameObject.transform.position); } }
private void fire(Vector3 direction) { Bullet _bullet = BulletManager.GetBullet(); _bullet.transform.position = transform.position + direction; _bullet.Fire(direction, FireType == EFireType.Fast ? 50 : 10, Power); }
private void _FireBullet() { if (Time.frameCount % 20 == 0) { bulletManager.GetBullet(transform.position); } }
private void FireBullet() { // Delays The bullet Coming out if (Time.frameCount % 5 == 0) { bulletManager.GetBullet(transform.position); } }
private void _FireBullet() { //delay bullet firing every 40 frames if (Time.frameCount % 40 == 0) { bulletManager.GetBullet(transform.position); } }
private void FireBullet() { if (Time.frameCount % 6 == 0 && GameUI.gamePaused == false) // Editor value - 60 { bulletManager.GetBullet(transform.position); SoundManager.PlaySound("sfx_laser1"); } }
private void FireBullet() { _soundManager.DoBulletSound(); Bullet bullet = _bulletManager.GetBullet(); bullet.Fire(_firePosition); _lastTimeFire = Time.time; }
private void _FireBullet() { // delay bullet firing if (Time.frameCount % 60 == 0 && bulletManager.HasBullets()) { bulletManager.GetBullet(transform.position); } }
private void _FireBullet() { // delay bullet firing if (Time.frameCount % 120 == 0 && bulletManager.HasBullets()) { FindObjectOfType <AudioManager>().PlaySound("FireBullet"); bulletManager.GetBullet(transform.position + new Vector3(0.0f, 1.0f)); } }
public void Fire() { if (firingDelay >= 1.0f) { if (facingRight) { bulletManager.GetBullet(bulletSpawnPoint.position, 1); firingDelay = 0; } else { bulletManager.GetBullet(bulletSpawnPoint.position, -1); firingDelay = 0; } audioSource.clip = soundEffects[(int)ImpulseSounds.SHOOT]; audioSource.Play(); } }
//Aim and shoot at player private void shootPlayer() { Bullet _bullet = BulletManager.GetBullet(); Vector3 _direction = (m_player.transform.position - transform.position); _direction = new Vector2(_direction.x, _direction.y).normalized; _bullet.transform.position = transform.position + _direction; _bullet.Fire(_direction, 7.5f, Damage, false); }
public void Fire() { if (firingDelay >= 0.5f) { bulletManager.GetBullet(new Vector3(transform.position.x, transform.position.y + 0.6f, transform.position.z)); firingDelay = 0; // Reset the timer GetComponent <AudioSource>().clip = soundclips[0]; GetComponent <AudioSource>().Play(); } }
public override void AddBullet(List <Sprite> sprites) { var bullet = BulletManager.GetBullet(Direction, Position, LinearVelocity, this, (int)Config.TrackStyle.NormalTrack, 2, (int)Config.BulletStyle.Bullet0); if (Power == 0) { Power = bullet.Power; } sprites.Add(bullet); }
IEnumerator FireBullet() { if (!firing) { bulletManager.GetBullet(transform.position); firing = true; yield return(new WaitForSeconds(fireRate)); firing = false; } }
public void FireBullet(int index, Vector3 position, Vector2 direction, string bulletLayer) { Bullet newBullet = GetActive().GetComponent <Bullet>(); newBullet.gameObject.layer = LayerMask.NameToLayer(bulletLayer); BulletData thisData = bulletData.GetBullet(index); newBullet.gameObject.SetActive(true); newBullet.Initialize(thisData.animator, thisData.radius, direction.normalized * thisData.speed); newBullet.transform.position = position; }
public void _FireBullet() { positionBullet.x = transform.position.x - 0.2f; positionBullet.y = transform.position.y + 0.9f; positionBullet.z = transform.position.z; // delay bullet firing if (Time.frameCount % 30 == 0 && bulletManager.HasBullets()) { bulletManager.GetBullet(positionBullet); } }
public override void Shoot(List <Sprite> sprites) { var bullet = BulletManager.GetBullet(new Vector2(0, 1), Position, 1.5f, this, (int)Config.TrackStyle.TailTrack, 1, (int)Config.BulletStyle.Bullet1); if (Power == 0) { Power = bullet.Power; } sprites.Add(bullet); }
//Previous movement, will be deleted later //void FixedUpdate() //{ // float moveHorizontal = Input.GetAxis("Horizontal"); // float moveVertical = Input.GetAxis("Vertical"); // Vector2 movement = new Vector2(moveHorizontal, moveVertical); // movement *= Time.deltaTime; // movement *= speed; // // rb2d.AddForce(movement); // transform.Translate(movement); //} private void _FireBullet() { if (Input.touchCount > 0) { if (Time.frameCount % 60 == 0) { //Vector3 bulletPosition = new Vector3(transform.position.x, transform.position.y + 1.1f, transform.position.z); bulletManager.GetBullet(transform.position); SoundManagerScript.PlaySound("shoot"); } } }
private void _Fire() { if (Input.GetAxisRaw("Fire1") > 0.0f) { // delays firing if (Time.frameCount % fireRate == 0) { var tempBullet = bulletManager.GetBullet(bulletSpawn.position, bulletSpawn.forward); tempBullet.transform.SetParent(bulletManager.gameObject.transform); } } }
// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.Space)) { Bullet newBullet = bulletManager.GetBullet(); if (newBullet) { newBullet.transform.position = nozzle.transform.position; newBullet.transform.rotation = nozzle.transform.rotation; newBullet.rigidbody.velocity = nozzle.transform.up * speed; } } }
private void _Fire() { if (Input.GetMouseButtonDown(0)) { // delays firing // if (Time.frameCount % fireRate == 0) // { var tempBullet = bulletManager.GetBullet(bulletSpawn.position, bulletSpawn.forward); tempBullet.transform.SetParent(bulletManager.gameObject.transform); // } } }
private void _Fire() { if (Input.GetMouseButton(0)) { // delays firing if (Time.frameCount - lastFrame >= fireRate) { var tempBullet = bulletManager.GetBullet(bulletSpawn.position, bulletSpawn.forward); tempBullet.transform.SetParent(bulletManager.gameObject.transform); lastFrame = Time.frameCount; shootSound.Play(); } } }
void Shoot() { if (myTimerInBetweenshots >= myTimeInBetweenShots) { myShootEffect.Play(); AudioManager.ourPublicInstance.PlaySFX1(myShootClip, myShootVolume); myBulletManager.GetBullet(transform.position, transform.rotation, mySpeed, damage, bulletLifeTime, myScale); myTimerInBetweenshots = 0; } else { myTimerInBetweenshots = myTimerInBetweenshots + Time.deltaTime; } }
private void _Fire() { if (Input.GetAxisRaw("Fire1") > 0.0f) { // delays firing if (Time.frameCount % fireRate == 0) { var tempBullet = bulletManager.GetBullet(bulletSpawn.position, bulletSpawn.forward); tempBullet.transform.SetParent(bulletManager.gameObject.transform); } } if (Input.GetKeyDown(KeyCode.P)) //key p to go back to main scene { m_sceneManager.openScene("StartScene"); //UnityEngine.SceneManagement.SceneManager.LoadScene("StartScene", UnityEngine.SceneManagement.LoadSceneMode.Single); } }
private void _Fire() { if (Input.GetAxisRaw("Fire1") > 0.0f) { fireTimer += Time.deltaTime; // delays firing if (fireTimer - fireInterval > 0) { fireTimer -= fireInterval; var tempBullet = bulletManager.GetBullet(bulletSpawn.position, bulletSpawn.forward); tempBullet.transform.SetParent(bulletManager.gameObject.transform); } } else { fireTimer = 0.0f; } }
public override void Shoot(List <Sprite> sprites) { var bullet1 = BulletManager.GetBullet(new Vector2(0, 1), Position, 1.5f, this, (int)Config.TrackStyle.TailTrack, 1, (int)Config.BulletStyle.Bullet1); //var track1 = new ConstTailTrack(this.left); //var track2 = new ConstTailTrack(this.right); var bullet2 = BulletManager.GetTrackBullet(new Vector2(0, 1), Position, 1.5f, this, (int)Config.TrackStyle.TailTrack, 1, (int)Config.BulletStyle.Bullet1, left); var bullet3 = BulletManager.GetTrackBullet(new Vector2(0, 1), Position, 1.5f, this, (int)Config.TrackStyle.TailTrack, 1, (int)Config.BulletStyle.Bullet1, right); if (Power == 0) { Power = bullet1.Power; } sprites.Add(bullet1); sprites.Add(bullet2); sprites.Add(bullet3); }
public void LastShoot(List <Sprite> sprites) { var bullet = BulletManager.GetBullet(new Vector2(0, 1), new Vector2(Position.X, Position.Y + 20), 3, this, (int)Config.TrackStyle.TailTrack, 1, (int)Config.BulletStyle.Bullet2); var bullet2 = BulletManager.GetBullet(new Vector2(-1, 1), new Vector2(Position.X - 40, Position.Y + 20), 3, this, (int)Config.TrackStyle.TailTrack, 1, (int)Config.BulletStyle.Bullet2); var bullet3 = BulletManager.GetBullet(new Vector2(1, 1), new Vector2(Position.X + 40, Position.Y + 20), 3, this, (int)Config.TrackStyle.TailTrack, 1, (int)Config.BulletStyle.Bullet2); if (Power == 0) { Power = bullet.Power; } sprites.Add(bullet); sprites.Add(bullet2); sprites.Add(bullet3); }
public override void Shoot(List <Sprite> sprites) { var bullet = BulletManager.GetBullet(new Vector2(0, 1), Position, 2, this, (int)Config.TrackStyle.TailTrack, 1, (int)Config.BulletStyle.Bullet1); float b2x = bullet.Direction.X + bias; float b2y = (float)Math.Sqrt(1 - Math.Pow(b2x, 2)); float b3x = bullet.Direction.X - bias; float b3y = (float)Math.Sqrt(1 - Math.Pow(b3x, 2)); var b2 = new Vector2(b2x, b2y); var b3 = new Vector2(b3x, b3y); var bullet2 = BulletManager.GetBullet(b2, Position, 2, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet1); var bullet3 = BulletManager.GetBullet(b3, Position, 2, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet1); if (Power == 0) { Power = bullet.Power; } sprites.Add(bullet); sprites.Add(bullet2); sprites.Add(bullet3); }
public void S_CrazyShoot(List <Sprite> sprites) { //var bullet = // BulletManager.GetBullet(new Vector2(0, 1), Position, 3, this, // (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); //var bullet1 = // BulletManager.GetBullet(new Vector2(1, 0), Position, 3, this, // (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); //var bullet2 = // BulletManager.GetBullet(new Vector2(-1, 1), Position, 3, this, // (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); //var bullet3 = // BulletManager.GetBullet(new Vector2(1, -1), Position, 3, this, // (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); //var bullet4 = // BulletManager.GetBullet(new Vector2(0, -1), Position, 3, this, // (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); //var bullet5 = // BulletManager.GetBullet(new Vector2(-1, 0), Position, 3, this, // (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); //var bullet6 = // BulletManager.GetBullet(new Vector2(1, 1), Position, 3, this, // (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); //var bullet7 = // BulletManager.GetBullet(new Vector2(-1, -1), Position, 3, this, // (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet = BulletManager.GetBullet(new Vector2(0, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet1 = BulletManager.GetBullet(new Vector2(1, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet2 = BulletManager.GetBullet(new Vector2(-1, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet3 = BulletManager.GetBullet(new Vector2(0.25f, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet4 = BulletManager.GetBullet(new Vector2(-0.25f, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet5 = BulletManager.GetBullet(new Vector2(0.75f, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet6 = BulletManager.GetBullet(new Vector2(-0.75f, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet7 = BulletManager.GetBullet(new Vector2(0.50f, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); var bullet8 = BulletManager.GetBullet(new Vector2(-0.50f, 1), Position, 3, this, (int)Config.TrackStyle.NormalTrack, 1, (int)Config.BulletStyle.Bullet3); if (Power == 0) { Power = bullet.Power; } sprites.Add(bullet); sprites.Add(bullet1); sprites.Add(bullet2); sprites.Add(bullet3); sprites.Add(bullet4); sprites.Add(bullet5); sprites.Add(bullet6); sprites.Add(bullet7); sprites.Add(bullet8); }