Some things
This commit is contained in:
parent
6ba30e430e
commit
e4cc23e7f0
119 changed files with 70085 additions and 682 deletions
16
Assets/Scripts/Level 1/Bullet1.cs
Normal file
16
Assets/Scripts/Level 1/Bullet1.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace Level1 {
|
||||
public class Bullet1 : MonoBehaviour {
|
||||
[SerializeField] float speed;
|
||||
|
||||
public void AddForce(int direction) {
|
||||
Rigidbody2D rb = GetComponent<Rigidbody2D>();
|
||||
rb.velocity = Vector2.right * direction * speed;
|
||||
}
|
||||
|
||||
void OnCollisionEnter2D(Collision2D other) {
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue