Make bullets even greater, and make them explode
This commit is contained in:
parent
66dec3d98c
commit
2daf97a490
File diff suppressed because it is too large
Load Diff
@ -7,6 +7,12 @@ namespace Saltosion.OneWeapon.Bullets {
|
||||
public class RevolverBullet : MonoBehaviour {
|
||||
|
||||
public Rigidbody2D Body;
|
||||
public GameObject Sprite;
|
||||
|
||||
public ParticleSystem Trail;
|
||||
public ParticleSystem Explosion;
|
||||
|
||||
private float DeathTimer = 0;
|
||||
|
||||
void Start() {
|
||||
Vector2 Direction = GetComponent<Bullet>().Direction;
|
||||
@ -14,6 +20,15 @@ namespace Saltosion.OneWeapon.Bullets {
|
||||
|
||||
Body.velocity = Direction * 15;
|
||||
Body.rotation = Rot - 90;
|
||||
|
||||
Explosion.Stop();
|
||||
}
|
||||
|
||||
void Update() {
|
||||
DeathTimer += Time.deltaTime;
|
||||
if (DeathTimer > 20) {
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D collider) {
|
||||
@ -21,8 +36,14 @@ namespace Saltosion.OneWeapon.Bullets {
|
||||
// don't hit the player!
|
||||
return;
|
||||
}
|
||||
Destroy(gameObject);
|
||||
Debug.Log("Boom!");
|
||||
Destroy(Sprite);
|
||||
Destroy(Body);
|
||||
Destroy(GetComponent<CapsuleCollider2D>());
|
||||
Explosion.Play();
|
||||
Trail.Stop();
|
||||
DeathTimer = 19;
|
||||
|
||||
// Do damage here, kill everyone
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user