Initial commit
This commit is contained in:
commit
3b96451047
71 changed files with 2302 additions and 0 deletions
22
addons/walkabout/basic_interactable.gd
Normal file
22
addons/walkabout/basic_interactable.gd
Normal file
|
@ -0,0 +1,22 @@
|
|||
@tool
|
||||
class_name WBBasicInteractive
|
||||
extends StaticBody2D
|
||||
## Collision object that emits a signal when interacted with by a player character.
|
||||
|
||||
|
||||
## Emitted when a player character interacts with this object.
|
||||
signal interacted()
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
for child in get_children():
|
||||
if child is CollisionShape2D or child is CollisionPolygon2D:
|
||||
return
|
||||
var col_shape := CollisionShape2D.new()
|
||||
col_shape.shape = RectangleShape2D.new()
|
||||
col_shape.shape.size = Vector2(8.0, 8.0)
|
||||
add_child(col_shape)
|
||||
|
||||
|
||||
func interact() -> void:
|
||||
interacted.emit()
|
Loading…
Add table
Add a link
Reference in a new issue