Added lava area and a resort town

This commit is contained in:
ObeseTermite 2024-10-06 18:18:35 -07:00
parent 18a2279cc3
commit 3befef5292
12 changed files with 267 additions and 19 deletions

View file

@ -11,6 +11,7 @@ config_version=5
[application] [application]
config/name="Courier" config/name="Courier"
run/main_scene="res://scenes/world.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility") config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg" config/icon="res://icon.svg"
@ -28,6 +29,7 @@ enabled=PackedStringArray()
player="" player=""
"delivery spot"="valid for spawning in contracts" "delivery spot"="valid for spawning in contracts"
"Telescope Label"="This label will be visible in the telescope" "Telescope Label"="This label will be visible in the telescope"
hurt="hurts the player"
[gui] [gui]
@ -65,6 +67,11 @@ interact={
] ]
} }
[layer_names]
2d_physics/layer_1="Collision"
2d_physics/layer_3="Hurt"
[rendering] [rendering]
renderer/rendering_method="gl_compatibility" renderer/rendering_method="gl_compatibility"

View file

@ -29,3 +29,4 @@ anchor_right = 1.0
offset_left = -102.0 offset_left = -102.0
offset_bottom = 40.0 offset_bottom = 40.0
grow_horizontal = 0 grow_horizontal = 0
size_flags_horizontal = 3

View file

@ -3,26 +3,22 @@
[ext_resource type="Texture2D" uid="uid://dcbrw64m2btod" path="res://sprites/runningshoes.png" id="1_0n0wt"] [ext_resource type="Texture2D" uid="uid://dcbrw64m2btod" path="res://sprites/runningshoes.png" id="1_0n0wt"]
[ext_resource type="Script" path="res://scripts/item_counter.gd" id="1_ehwcf"] [ext_resource type="Script" path="res://scripts/item_counter.gd" id="1_ehwcf"]
[node name="ItemCounter" type="Control" node_paths=PackedStringArray("ItemTexture")] [node name="ItemCounter" type="HBoxContainer" node_paths=PackedStringArray("ItemTexture")]
layout_mode = 3
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
offset_right = -1054.0
offset_bottom = -581.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("1_ehwcf") script = ExtResource("1_ehwcf")
ItemTexture = NodePath("Container/TextureRect") ItemTexture = NodePath("TextureRect")
[node name="Container" type="HBoxContainer" parent="."] [node name="Label" type="Label" parent="."]
layout_mode = 0
offset_right = 72.0
offset_bottom = 67.0
[node name="Label" type="Label" parent="Container"]
layout_mode = 2 layout_mode = 2
text = "1" text = "1"
[node name="TextureRect" type="TextureRect" parent="Container"] [node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 2 layout_mode = 2
texture = ExtResource("1_0n0wt") texture = ExtResource("1_0n0wt")
expand_mode = 2 expand_mode = 2

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=5 format=3 uid="uid://bjy3gfpx6h1w5"] [gd_scene load_steps=6 format=3 uid="uid://bjy3gfpx6h1w5"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_a7huw"] [ext_resource type="Script" path="res://scripts/player.gd" id="1_a7huw"]
[ext_resource type="Texture2D" uid="uid://dnxdkwa1krlv" path="res://sprites/ant.png" id="2_5v6iy"] [ext_resource type="Texture2D" uid="uid://dnxdkwa1krlv" path="res://sprites/ant.png" id="2_5v6iy"]
@ -8,6 +8,9 @@
radius = 25.0 radius = 25.0
height = 100.0 height = 100.0
[sub_resource type="CircleShape2D" id="CircleShape2D_l5dck"]
radius = 22.0
[node name="Player" type="CharacterBody2D" groups=["player"]] [node name="Player" type="CharacterBody2D" groups=["player"]]
z_index = 1 z_index = 1
motion_mode = 1 motion_mode = 1
@ -28,3 +31,12 @@ zoom = Vector2(0.3, 0.3)
visible = false visible = false
scale = Vector2(0.134766, 0.134766) scale = Vector2(0.134766, 0.134766)
texture = ExtResource("3_peuqy") texture = ExtResource("3_peuqy")
[node name="Hitbox" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
shape = SubResource("CircleShape2D_l5dck")
[connection signal="body_entered" from="Hitbox" to="." method="_on_hitbox_body_entered"]

File diff suppressed because one or more lines are too long

View file

@ -23,6 +23,6 @@ func _process(delta: float) -> void:
if ContractSpawnPositions[i].get_child_count() == 0: if ContractSpawnPositions[i].get_child_count() == 0:
var newContract = ContractScene.instantiate() var newContract = ContractScene.instantiate()
newContract.Destination = PossibleContracts.pick_random() newContract.Destination = PossibleContracts.pick_random()
newContract.Money = (int(newContract.Destination.global_position.distance_to(global_position))/100)*10 newContract.Money = (int(newContract.Destination.global_position.distance_to(global_position))/100)*10*newContract.Destination.CashMultiplier
ContractSpawnPositions[i].add_child(newContract) ContractSpawnPositions[i].add_child(newContract)

View file

@ -10,6 +10,8 @@ var Player : Node2D
var WaitingCash : int = 0 var WaitingCash : int = 0
@export var CashMultiplier : float = 1
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
Dialogue.DialogueLabel.text = get_address(false) Dialogue.DialogueLabel.text = get_address(false)

View file

@ -25,10 +25,10 @@ func _ready() -> void:
match item: match item:
"Shoes": "Shoes":
Cost = 200 Cost = 600
Dialogue.DialogueLabel.text = "Running Shoes" Dialogue.DialogueLabel.text = "Running Shoes"
"Drill": "Drill":
Cost = 400 Cost = 1800
Dialogue.DialogueLabel.text = "Dirt Drill" Dialogue.DialogueLabel.text = "Dirt Drill"
Sprite.texture = Textures[item] Sprite.texture = Textures[item]

View file

@ -1,6 +1,6 @@
extends Control extends Control
@onready var ItemCountLabel = $Container/Label @onready var ItemCountLabel = $Label
var Count = 0 var Count = 0
@export var ItemTexture : TextureRect @export var ItemTexture : TextureRect

View file

@ -10,7 +10,7 @@ var SpriteTurningSpeed = 5
var ActiveContract : Node2D var ActiveContract : Node2D
var Money : int = 0 @export var Money : int = 0
var Frozen = false var Frozen = false
@ -54,3 +54,9 @@ func _physics_process(delta: float) -> void:
PackageSprite.hide() PackageSprite.hide()
move_and_slide() move_and_slide()
func _on_hitbox_body_entered(body: Node2D) -> void:
if body.is_in_group("hurt"):
Money -= 500
position = Vector2(0,0)

BIN
sprites/tiles/lava.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c6rehqvvmrbpl"
path="res://.godot/imported/lava.png-20854f5778b44ac2e175508fb929632a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/tiles/lava.png"
dest_files=["res://.godot/imported/lava.png-20854f5778b44ac2e175508fb929632a.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