random stuff i forgot to commit

This commit is contained in:
Sylvia 2026-06-26 14:37:33 -07:00
parent 274af1e5a1
commit b0625ae834
59 changed files with 7806 additions and 664 deletions

View file

@ -0,0 +1,32 @@
using System;
using UnityEngine;
public class Projectile : MonoBehaviour
{
[SerializeField] private Rigidbody2D rb;
public int damage;
public float speed;
public float lifetime;
public Vector2 direction;
private void Start()
{
Destroy(gameObject, lifetime);
direction = transform.right;
}
private void FixedUpdate()
{
rb.linearVelocity = direction * speed;
}
private void OnTriggerEnter2D(Collider2D other)
{
if (!other.CompareTag(tag) && other.TryGetComponent(out Entity isEntity))
{
isEntity.TakeDamage(damage);
Destroy(gameObject);
}
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 6cb8b1c6e38733b8a846a00e4b0ad87b