giants-godot/entities/entity.gd
2021-09-08 18:36:41 +02:00

18 lines
347 B
GDScript

extends RigidBody
class_name Entity
const DEFAULT_GRAVITY = 0
const DEFAULT_MASS = 1
func _init():
gravity_scale = DEFAULT_GRAVITY
mass = DEFAULT_MASS
contact_monitor = true
contacts_reported = 10
connect("body_entered", self, "_on_body_entered")
func _on_body_entered(body):
if has_method("body_entered"):
call("body_entered", body)