This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues/pull-requests.
evospace/entities/bullet/bullet.gd

16 lines
384 B
GDScript
Raw Permalink Normal View History

2020-09-06 23:02:19 +03:00
extends KinematicBody2D
var damage = 1.0
var velocity = Vector2()
func _physics_process(delta):
var collision_info = move_and_collide(velocity)
if collision_info:
var collision_point = collision_info.position
if(collision_info.collider is Enemy):
(collision_info.collider as Enemy).damage(damage)
queue_free()
func _on_visiblity_notifier_screen_exited():
queue_free()