initial commit

This commit is contained in:
Simo-Pekka Kerkelä 2025-07-11 00:14:08 +03:00
commit 35bb9bb38f
No known key found for this signature in database
46 changed files with 1243 additions and 0 deletions

24
Bullet.gd Normal file
View file

@ -0,0 +1,24 @@
extends Node2D
var velocity : Vector2 = Vector2.ZERO
var lifetime : float = 3.0
const speed = 300
func _ready():
pass
func init(p_velocity : Vector2):
velocity = p_velocity
func _process(delta):
position += velocity * delta * speed
lifetime -= delta
if lifetime < 0:
queue_free()
func _on_BulletArea_body_entered(body):
if body.has_method("is_player"):
return
if body.has_method("take_damage"):
body.take_damage(1)
queue_free()