the-crypt/ai/Enemy.gd
2020-07-20 14:59:31 -05:00

21 lines
319 B
GDScript

extends KinematicBody2D
class_name Enemy
var speed = 60
var gravity = 500
var health = 1
const UP = Vector2(0, -1)
var velocity = Vector2()
func get_type():
return "enemy"
func apply_gravity(delta, modifier = 1):
velocity.y += gravity * delta * modifier
if is_on_wall() and is_on_floor():
velocity.y = -150