25 lines
613 B
GDScript
25 lines
613 B
GDScript
extends Area2D
|
|
class_name Interactable
|
|
|
|
var available : bool = true
|
|
|
|
func _ready():
|
|
printerr("Abstract Interactable class used")
|
|
|
|
func can_interact(_p : Player) -> bool:
|
|
return true
|
|
|
|
func interact_requirement_text() -> String:
|
|
return ""
|
|
|
|
func interact(_p : Player) -> bool:
|
|
printerr("Interact function called on abstract Interactable class")
|
|
return false
|
|
|
|
func generate_collision(area_width : float):
|
|
var collision = CollisionShape2D.new()
|
|
var collision_shape = CircleShape2D.new()
|
|
collision_shape.radius = area_width
|
|
|
|
collision.shape = collision_shape
|
|
add_child(collision) |