extends Area2D

var motion = Vector2.ZERO
var type = 4
var id = ''
var fliph = false
var target = 'enemy'
var dmg = 1
#func _ready():
#	print('bullet gen...')

func _physics_process(delta):
	global_position += (motion*delta)

func _on_bullet_body_entered(collide):
	if collide: 
		if collide.is_in_group(target):
			collide.damage(-dmg,id)
			print('col enemy')
			queue_free()
		if collide.is_in_group('terrain'):
			queue_free()

func _on_Timer_timeout():
	queue_free()
	pass # Replace with function body.
