the-crypt/ai/Enemy.gd
2020-07-19 23:45:39 -05:00

20 lines
318 B
GDScript

extends KinematicBody2D
class_name Enemy
var speed = 60
var gravity = 500
var health = 5
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