boogit
This commit is contained in:
parent
f5ad603864
commit
ae7b962896
101 changed files with 1520 additions and 0 deletions
19
main.gd
Normal file
19
main.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Node2D
|
||||
|
||||
var held_object = false
|
||||
|
||||
func _ready():
|
||||
# print($TileMap.get_cell_source_id(0, Vector2i(-5, -5)))
|
||||
for node in get_tree().get_nodes_in_group("pickable"):
|
||||
node.clicked.connect(_on_pickable_clicked)
|
||||
|
||||
func _on_pickable_clicked(object):
|
||||
if !held_object:
|
||||
object.pickup()
|
||||
held_object = object
|
||||
|
||||
func _unhandled_input(event):
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT:
|
||||
if held_object and !event.pressed:
|
||||
held_object.drop(Input.get_last_mouse_velocity() / 5.0)
|
||||
held_object = null
|
Loading…
Add table
Add a link
Reference in a new issue