It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
17
Interactions/Pickupable/Pickupable.gd
Normal file
17
Interactions/Pickupable/Pickupable.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends Interaction
|
||||
|
||||
func _ready():
|
||||
add_action("Pick Up", pickUp)
|
||||
|
||||
func pickUp():
|
||||
var item = get_parent().item
|
||||
|
||||
var player = GameVariables.player
|
||||
if player.currentInteractingItem == item:
|
||||
player.change_state("Idle")
|
||||
|
||||
if get_parent().keyItem:
|
||||
InventoryManager.add_item_to_inventory(item, 1, "keyItems")
|
||||
else:
|
||||
InventoryManager.add_item_to_inventory(item)
|
||||
get_parent().queue_free()
|
||||
7
Interactions/Pickupable/Pickupable.tscn
Normal file
7
Interactions/Pickupable/Pickupable.tscn
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bt2n0yqtg4rdu"]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://Interactions/Interactable/interaction.tscn" id="1_sas5q"]
|
||||
[ext_resource type="Script" path="res://Interactions/Pickupable/Pickupable.gd" id="2_v4ydm"]
|
||||
|
||||
[node name="Pickupable" instance=ExtResource("1_sas5q")]
|
||||
script = ExtResource("2_v4ydm")
|
||||
Loading…
Add table
Add a link
Reference in a new issue