Enemies half done
This commit is contained in:
parent
eaa8cdd462
commit
16507f4121
93 changed files with 31744 additions and 119 deletions
|
@ -25,10 +25,13 @@ namespace Level10 {
|
|||
|
||||
void OnCollisionEnter2D(Collision2D other) {
|
||||
--_currentBounces;
|
||||
if (_currentBounces != 0 && !other.gameObject.CompareTag("Enemy")) return;
|
||||
if (_currentBounces != 0 || other.gameObject.CompareTag("Enemy")) return;
|
||||
|
||||
--PlayerMovement10.instance.Bullets;
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
void OnDestroy() {
|
||||
--PlayerMovement10.instance.Bullets;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,11 +10,13 @@ namespace Level10 {
|
|||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D other) {
|
||||
if (!other.CompareTag("Player")) return;
|
||||
if (!other.CompareTag("Player") && !other.CompareTag("Bullet")) return;
|
||||
PlayerMovement10 player = other.GetComponent<PlayerMovement10>();
|
||||
|
||||
player.Rb.velocity = new Vector2(player.Rb.velocity.x, player.deathForce);
|
||||
player.Animator.SetTrigger(PlayerMovement10.Jump1);
|
||||
if(player) player.Rb.velocity = new Vector2(player.Rb.velocity.x, player.deathForce);
|
||||
if(player) player.Animator.SetTrigger(PlayerMovement10.Jump1);
|
||||
|
||||
if(!player) Destroy(other.gameObject);
|
||||
Destroy(_enemy.gameObject);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue