CheatCode/mob.gd

19 lines
469 B
GDScript

extends RigidBody2D
var mob_types = ["up", "down", "left", "right"]
# Called when the node enters the scene tree for the first time.
func _ready():
var mob_type = mob_types[randi() % mob_types.size()]
$AnimatedSprite2D.play(mob_type)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_visible_on_screen_notifier_2d_screen_exited():
queue_free()
func add_gravity():
gravity_scale += 0.1
mass += 0.1