Flopsy/objects/characters/monsters/monster.gd

28 lines
541 B
GDScript

extends "res://objects/characters/character.gd"
export var speed: int = 50
export var reverse_direction: bool = false
export var damage : int = 5
func _ready():
if reverse_direction:
velocity.x = -speed
else:
velocity.x = speed
func _process(delta):
if velocity != null:
if velocity.x > 0:
$Sprite.flip_h = true
elif velocity.x < 0:
$Sprite.flip_h = false
if health <= 0 and $Collision.disabled == false:
velocity = null
$Collision.disabled = true
_die()
func stomped_on_head():
pass
func _die():
pass