Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from erbilnas/feature/asteroid-field
Browse files Browse the repository at this point in the history
add asteroid field and collision for firing
  • Loading branch information
erbilnas authored Jan 10, 2022
2 parents 4d0b171 + 0c720d5 commit fb6183e
Show file tree
Hide file tree
Showing 16 changed files with 379 additions and 30 deletions.
Binary file added Assets/Art/Spaceflash/Audio/Explosion.mp3
Binary file not shown.
36 changes: 36 additions & 0 deletions Assets/Art/Spaceflash/Audio/Explosion.mp3.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 43 additions & 25 deletions Assets/Art/Spaceflash/Prefabs/Asteriod.prefab
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions Assets/Art/Spaceflash/Prefabs/AsteroidExplosion.prefab
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions Assets/Art/Spaceflash/Prefabs/LaserBeam.prefab

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions Assets/Scenes/MainScene.unity

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Assets/Scripts/AsteroidCollison.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AsteroidCollison : MonoBehaviour
{
[SerializeField] private GameObject asteroidExplosion;
public void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Asteroid")
{
Destroy(collision.gameObject);

Instantiate(asteroidExplosion, collision.transform.position, collision.transform.rotation);

Destroy(gameObject);
} else {
Destroy(gameObject);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/AsteroidCollison.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Assets/Scripts/AsteroidKillzone.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AsteroidKillzone : MonoBehaviour
{

public void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Asteroid")
{
Destroy(other.gameObject);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/AsteroidKillzone.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fb6183e

Please sign in to comment.