Added signs and address heirarchies
This commit is contained in:
parent
800ea55d95
commit
f6d91820c6
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://cpxco37ip15ev"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cpxco37ip15ev"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ci3yxj63e5u8f" path="res://sprites/contractgiver.png" id="1_awtl7"]
|
||||
[ext_resource type="Script" path="res://scripts/sign.gd" id="1_e2wbr"]
|
||||
[ext_resource type="PackedScene" uid="uid://sk2uc8hcxhcj" path="res://scenes/physical_dialogue.tscn" id="3_dlmpa"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwqurhly8osd" path="res://scenes/interactible_manager.tscn" id="4_1m1bm"]
|
||||
|
||||
|
@ -10,7 +11,10 @@ radius = 389.155
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sdg4f"]
|
||||
size = Vector2(409, 181)
|
||||
|
||||
[node name="ContractGiver" type="Area2D"]
|
||||
[node name="ContractGiver" type="Area2D" node_paths=PackedStringArray("Dialogue")]
|
||||
script = ExtResource("1_e2wbr")
|
||||
text = "Hello Dear Employee"
|
||||
Dialogue = NodePath("Dialogue")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_awtl7")
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://cpnkpl8rmrt00"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/gui.gd" id="1_42w6u"]
|
||||
[ext_resource type="Script" path="res://scripts/gui.gd" id="1_42w6u"]
|
||||
[ext_resource type="Theme" uid="uid://d0ir0t347wqv7" path="res://etc/default_theme.tres" id="2_54lln"]
|
||||
|
||||
[node name="Gui" type="CanvasLayer"]
|
||||
script = ExtResource("1_42w6u")
|
||||
|
||||
[node name="MoneyCounter" type="Label" parent="."]
|
||||
[node name="List" type="VBoxContainer" parent="."]
|
||||
offset_right = 40.0
|
||||
offset_bottom = 23.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="MoneyCounter" type="Label" parent="List"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_54lln")
|
||||
text = "$100"
|
||||
|
||||
[node name="CurrentAddress" type="Label" parent="List"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_54lln")
|
||||
text = "No Contract"
|
||||
|
|
31
scenes/sign.tscn
Normal file
31
scenes/sign.tscn
Normal file
|
@ -0,0 +1,31 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://bosjbcurkm2vf"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c6gswajm0atas" path="res://sprites/sign.png" id="1_6ooja"]
|
||||
[ext_resource type="Script" path="res://scripts/sign.gd" id="1_rtygf"]
|
||||
[ext_resource type="PackedScene" uid="uid://sk2uc8hcxhcj" path="res://scenes/physical_dialogue.tscn" id="2_yp6hc"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwqurhly8osd" path="res://scenes/interactible_manager.tscn" id="3_q68wy"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_8hxuu"]
|
||||
radius = 168.19
|
||||
|
||||
[node name="Sign" type="Area2D" node_paths=PackedStringArray("Dialogue")]
|
||||
script = ExtResource("1_rtygf")
|
||||
text = "Default Text"
|
||||
Dialogue = NodePath("Dialogue")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.4, 0.4)
|
||||
texture = ExtResource("1_6ooja")
|
||||
|
||||
[node name="Dialogue" parent="." instance=ExtResource("2_yp6hc")]
|
||||
offset_top = -185.445
|
||||
offset_bottom = -145.445
|
||||
|
||||
[node name="InteractibleManager" parent="." node_paths=PackedStringArray("ItemShown") instance=ExtResource("3_q68wy")]
|
||||
ItemShown = NodePath("../Dialogue")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_8hxuu")
|
||||
|
||||
[connection signal="body_entered" from="." to="InteractibleManager" method="_on_body_entered"]
|
||||
[connection signal="body_exited" from="." to="InteractibleManager" method="_on_body_exited"]
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=10 format=4 uid="uid://72e8cy3uuy8m"]
|
||||
[gd_scene load_steps=11 format=4 uid="uid://72e8cy3uuy8m"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://tqbjd6io6qfa" path="res://sprites/ground.jpg" id="1_deahv"]
|
||||
[ext_resource type="PackedScene" uid="uid://bjy3gfpx6h1w5" path="res://scenes/player.tscn" id="2_jm6jq"]
|
||||
|
@ -7,6 +7,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://cn41xqc3lwaxy" path="res://scenes/contract.tscn" id="5_q4ykf"]
|
||||
[ext_resource type="PackedScene" uid="uid://bm1ptkidbwi36" path="res://scenes/delivery_spot.tscn" id="6_i8g18"]
|
||||
[ext_resource type="PackedScene" uid="uid://cpnkpl8rmrt00" path="res://scenes/gui.tscn" id="7_fn24d"]
|
||||
[ext_resource type="PackedScene" uid="uid://bosjbcurkm2vf" path="res://scenes/sign.tscn" id="8_d0mjk"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_knvup"]
|
||||
texture = ExtResource("3_3e26l")
|
||||
|
@ -33,7 +34,7 @@ metadata/_edit_lock_ = true
|
|||
|
||||
[node name="walls" type="TileMapLayer" parent="."]
|
||||
modulate = Color(0.687215, 0.687215, 0.687215, 1)
|
||||
tile_map_data = PackedByteArray("AAACAP7/AAAAAAAAAAACAP//AAAAAAAAAAACAAAAAAAAAAAAAAACAAEAAAAAAAAAAAACAAIAAAAAAAAAAAACAAMAAAAAAAAAAAABAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAD//wMAAAAAAAAAAAD+/wMAAAAAAAAAAAACAP3/AAAAAAAAAAADAP3/AAAAAAAAAAAEAP3/AAAAAAAAAAAFAP3/AAAAAAAAAAAGAP3/AAAAAAAAAAAHAP3/A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AAAAAAAAAAEAPH/AAAAAAAAAAADAPH/AAAAAAAAAAACAPH/AAAAAAAAAADx//b/AAAAAAAAAADx//f/AAAAAAAAAADx//j/AAAAAAAAAADx//n/AAAAAAAAAADx//r/AAAAAAAAAADx//v/AAAAAAAAAADx//z/AAAAAAAAAAD9/wAAAAAAAAAAAAD9/wEAAAAAAAAAAAD9/wIAAAAAAAAAAAD9/wMAAAAAAAAAAAD2//b/AAAAAAAAAAD1//b/AAAAAAAAAAD0//b/AAAAAAAAAADz//b/AAAAAAAAAADy//b/AAAAAAAAAAD3//j/AAAAAAAAAAD3//f/AAAAAAAAAAD3//b/AAAAAAAAAAACAPL/AAAAAAAAAAACAPP/AAAAAAAAAAACAPT/AAAAAAAAAAACAPX/AAAAAAAAAAACAPb/AAAAAAAAAAACAPf/AAAAAAAAAAACAPj/AAAAAAAAAAABAPj/AAAAAAAAAAAAAPj/AAAAAAAAAAD3//n/AAAAAAAAAAD4//n/AAAAAAAAAAD///n/AAAAAAAAAAAAAPn/AAAAAAAAAAD///r/AAAAAAAAAAD+//r/AAAAAAAAAAD9//r/AAAAAAAAAAD8//r/AAAAAAAAAAD7//r/AAAAAAAAAAD6//r/AAAAAAAAAAD5//r/AAAAAAAAAAD4//r/AAAAAAAAAAD4/wAAAAAAAAAAAAD4/wEAAAAAAAAAAAD3/wEAAAAAAAAAAAD2/wEAAAAAAAAAAAD1/wEAAAAAAAAAAAD0/wEAAAAAAAAAAADz/wEAAAAAAAAAAADy/wEAAAAAAAAAAADx/wEAAAAAAAAAAADx/wAAAAAAAAAAAADx////AAAAAAAAAADx//7/AAAAAAAAAADx//3/AAAAAAAAAAD5/wAAAAAAAAAAAAD6/wAAAAAAAAAAAAD7/wAAAAAAAAAAAAD8/wAAAAAAAAAAAAA=")
|
||||
tile_set = SubResource("TileSet_g3b4o")
|
||||
|
||||
[node name="ContractGiver" parent="." instance=ExtResource("4_0h7cx")]
|
||||
|
@ -41,20 +42,22 @@ position = Vector2(779, -1420)
|
|||
|
||||
[node name="Contract" parent="ContractGiver" node_paths=PackedStringArray("Destination") instance=ExtResource("5_q4ykf")]
|
||||
position = Vector2(6, 779)
|
||||
Destination = NodePath("../../DeliverySpot")
|
||||
Destination = NodePath("../../Fuck You Lane/1234")
|
||||
Money = 150
|
||||
|
||||
[node name="Contract2" parent="ContractGiver" node_paths=PackedStringArray("Destination") instance=ExtResource("5_q4ykf")]
|
||||
position = Vector2(501, 767)
|
||||
Destination = NodePath("../../DeliverySpot2")
|
||||
|
||||
[node name="DeliverySpot" parent="." instance=ExtResource("6_i8g18")]
|
||||
position = Vector2(-1438, -806)
|
||||
Address = "1234 Fuck You Lane"
|
||||
|
||||
[node name="DeliverySpot2" parent="." instance=ExtResource("6_i8g18")]
|
||||
position = Vector2(-1444, -147)
|
||||
Address = "1235 Fuck You Lane"
|
||||
Destination = NodePath("../../Fuck You Lane/1235")
|
||||
|
||||
[node name="Gui" parent="." node_paths=PackedStringArray("Player") instance=ExtResource("7_fn24d")]
|
||||
Player = NodePath("../Player")
|
||||
|
||||
[node name="Fuck You Lane" parent="." instance=ExtResource("8_d0mjk")]
|
||||
position = Vector2(-782, -268)
|
||||
text = "Fuck You Lane"
|
||||
|
||||
[node name="1234" parent="Fuck You Lane" instance=ExtResource("6_i8g18")]
|
||||
position = Vector2(-656, -538)
|
||||
|
||||
[node name="1235" parent="Fuck You Lane" instance=ExtResource("6_i8g18")]
|
||||
position = Vector2(-662, 121)
|
||||
|
|
|
@ -11,7 +11,7 @@ var Player : Node2D
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
DestinationDialogue.DialogueLabel.text = Destination.Address + " - $" + str(Money)
|
||||
DestinationDialogue.DialogueLabel.text = Destination.get_address() + " - $" + str(Money)
|
||||
Player = get_tree().get_first_node_in_group("player")
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
extends Area2D
|
||||
|
||||
@export var Address : String
|
||||
@onready var Dialogue : Control = $Dialogue
|
||||
|
||||
@onready var InteractibleManager = $InteractibleManager
|
||||
|
@ -11,7 +10,7 @@ var WaitingCash : int = 0
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
Dialogue.DialogueLabel.text = Address
|
||||
Dialogue.DialogueLabel.text = get_address(false)
|
||||
Player = get_tree().get_first_node_in_group("player")
|
||||
|
||||
|
||||
|
@ -20,3 +19,8 @@ func _process(delta: float) -> void:
|
|||
if Input.is_action_pressed("interact") and InteractibleManager.selected and Player.ActiveContract == self:
|
||||
Player.ActiveContract = null
|
||||
Player.Money += WaitingCash
|
||||
|
||||
func get_address(street: bool = true) -> String:
|
||||
var address = name
|
||||
if(street): address += " " + get_parent().name
|
||||
return address
|
||||
|
|
|
@ -2,7 +2,9 @@ extends CanvasLayer
|
|||
|
||||
@export var Player : Node2D
|
||||
|
||||
@onready var MoneyCounter = $MoneyCounter
|
||||
@onready var MoneyCounter = $List/MoneyCounter
|
||||
|
||||
@onready var CurrentAddress = $List/CurrentAddress
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
|
@ -12,3 +14,8 @@ func _ready() -> void:
|
|||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
MoneyCounter.text = "$" + str(Player.Money)
|
||||
|
||||
if Player.ActiveContract:
|
||||
CurrentAddress.text = Player.ActiveContract.get_address()
|
||||
else:
|
||||
CurrentAddress.text = "No Active Contract"
|
14
scripts/sign.gd
Normal file
14
scripts/sign.gd
Normal file
|
@ -0,0 +1,14 @@
|
|||
extends Area2D
|
||||
|
||||
@export var text : String
|
||||
|
||||
@export var Dialogue : Control
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
Dialogue.DialogueLabel.text = text
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
BIN
sprites/sign.png
Normal file
BIN
sprites/sign.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
34
sprites/sign.png.import
Normal file
34
sprites/sign.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c6gswajm0atas"
|
||||
path="res://.godot/imported/sign.png-f228fb152842d5c2a03a395b6c8a6963.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sprites/sign.png"
|
||||
dest_files=["res://.godot/imported/sign.png-f228fb152842d5c2a03a395b6c8a6963.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
Loading…
Reference in a new issue