It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
16
Interactions/Shopping/ShopHaver.gd
Normal file
16
Interactions/Shopping/ShopHaver.gd
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
extends Interaction
|
||||
|
||||
@onready var shopInterface:Window = $ShopInterface
|
||||
|
||||
var shopInventory = []
|
||||
|
||||
func _ready():
|
||||
add_action("Shop", open_shop)
|
||||
instantiate_shop_inventory()
|
||||
|
||||
func open_shop():
|
||||
shopInterface.popup_centered()
|
||||
shopInterface.opened()
|
||||
|
||||
func instantiate_shop_inventory():
|
||||
$ShopInterface.shopItems = shopInventory
|
||||
11
Interactions/Shopping/ShopHaver.tscn
Normal file
11
Interactions/Shopping/ShopHaver.tscn
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dkcbmgfe3yk6y"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://oe2gkhrdpuh2" path="res://Interactions/Interactable/interaction.tscn" id="1_2ps32"]
|
||||
[ext_resource type="Script" path="res://Interactions/Shopping/ShopHaver.gd" id="2_egsw3"]
|
||||
[ext_resource type="PackedScene" uid="uid://b52b85cx77aoq" path="res://UI/Shopping/ShopInterface.tscn" id="3_qdqe7"]
|
||||
|
||||
[node name="ShopHaver" instance=ExtResource("1_2ps32")]
|
||||
script = ExtResource("2_egsw3")
|
||||
|
||||
[node name="ShopInterface" parent="." index="0" instance=ExtResource("3_qdqe7")]
|
||||
visible = false
|
||||
24
Interactions/Shopping/VeggieStandShop.gd
Normal file
24
Interactions/Shopping/VeggieStandShop.gd
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
extends "res://Interactions/Shopping/ShopHaver.gd"
|
||||
|
||||
func instantiate_shop_inventory():
|
||||
var turnip = load("res://Items/Foods/Veggie/Turnip.gd").new()
|
||||
var eggplant = load("res://Items/Foods/Veggie/Eggplant.gd").new()
|
||||
var carrot = load("res://Items/Foods/Veggie/Carrot.gd").new()
|
||||
var tomato = load("res://Items/Foods/Fruits/Tomato.gd").new()
|
||||
var broccoli = load("res://Items/Foods/Veggie/Broccoli.gd").new()
|
||||
var cucumber = load("res://Items/Foods/Veggie/Cucumber.gd").new()
|
||||
var corn = load("res://Items/Foods/Veggie/Corn.gd").new()
|
||||
var mustardSeed = load("res://Items/Foods/Seeds/MustardSeed.gd").new()
|
||||
|
||||
shopInventory = []
|
||||
|
||||
shopInventory.append(turnip)
|
||||
shopInventory.append(eggplant)
|
||||
shopInventory.append(carrot)
|
||||
shopInventory.append(tomato)
|
||||
shopInventory.append(broccoli)
|
||||
shopInventory.append(cucumber)
|
||||
shopInventory.append(corn)
|
||||
shopInventory.append(mustardSeed)
|
||||
|
||||
super.instantiate_shop_inventory()
|
||||
Loading…
Add table
Add a link
Reference in a new issue