25 lines
574 B
GDScript
25 lines
574 B
GDScript
extends InspectableEntity
|
|
class_name Interactable
|
|
|
|
var available : bool = true
|
|
|
|
func can_interact(_p : Player) -> bool:
|
|
return true
|
|
|
|
func interaction_cost(_p : Player) -> int:
|
|
return 0
|
|
|
|
func interact(_p : Player) -> bool:
|
|
printerr("Interact function called on abstract Interactable class")
|
|
return false
|
|
|
|
func generate_collision(area_width : float) -> CollisionShape2D:
|
|
var collision = CollisionShape2D.new()
|
|
var collision_shape = CircleShape2D.new()
|
|
collision_shape.radius = area_width
|
|
|
|
collision.shape = collision_shape
|
|
add_child(collision)
|
|
|
|
return collision
|