Fuel tank refueling, dialogue sounds, retro filter adjustments

This commit is contained in:
ToasterPanic 2025-12-04 16:32:46 -05:00
parent f5d51b400a
commit 45c79db18c
8 changed files with 104 additions and 17 deletions

View file

@ -40,7 +40,7 @@ shader = ExtResource("12_kvuet")
shader_parameter/shake = 0.002000000095 shader_parameter/shake = 0.002000000095
shader_parameter/noiseQuality = 250.0 shader_parameter/noiseQuality = 250.0
shader_parameter/noiseIntensity = 0.0010000000475 shader_parameter/noiseIntensity = 0.0010000000475
shader_parameter/offsetIntensity = 0.0045 shader_parameter/offsetIntensity = 0.0
shader_parameter/colorOffsetIntensity = 0.10000000149012 shader_parameter/colorOffsetIntensity = 0.10000000149012
shader_parameter/pixelSize = 1024.0 shader_parameter/pixelSize = 1024.0
shader_parameter/grainIntensity = 0.04 shader_parameter/grainIntensity = 0.04

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=45 format=4 uid="uid://by43ihcec8e8q"] [gd_scene load_steps=46 format=4 uid="uid://by43ihcec8e8q"]
[ext_resource type="Script" uid="uid://b2sw6ymaf4t0s" path="res://scripts/game_ground.gd" id="1_6ra5r"] [ext_resource type="Script" uid="uid://b2sw6ymaf4t0s" path="res://scripts/game_ground.gd" id="1_6ra5r"]
[ext_resource type="AudioStream" uid="uid://dgv01wy8r7ej2" path="res://sounds/uglyburger.mp3" id="2_5vwr8"] [ext_resource type="AudioStream" uid="uid://dgv01wy8r7ej2" path="res://sounds/uglyburger.mp3" id="2_5vwr8"]
[ext_resource type="Script" uid="uid://dowu512otgyyf" path="res://scripts/player_ground.gd" id="3_8gbjj"] [ext_resource type="Script" uid="uid://dowu512otgyyf" path="res://scripts/player_ground.gd" id="3_8gbjj"]
[ext_resource type="AudioStream" uid="uid://cdl70q0x28717" path="res://sounds/dialogue.mp3" id="3_rncil"]
[ext_resource type="Texture2D" uid="uid://c0cyhybh30ogt" path="res://textures/player-ground-sheet.png" id="4_2c1ag"] [ext_resource type="Texture2D" uid="uid://c0cyhybh30ogt" path="res://textures/player-ground-sheet.png" id="4_2c1ag"]
[ext_resource type="Texture2D" uid="uid://xs6tjca62pw1" path="res://textures/wall_side_tile.png" id="4_8gbjj"] [ext_resource type="Texture2D" uid="uid://xs6tjca62pw1" path="res://textures/wall_side_tile.png" id="4_8gbjj"]
[ext_resource type="Texture2D" uid="uid://ddfp7u4a7llnr" path="res://textures/wall_side_tile_left.png" id="5_176r3"] [ext_resource type="Texture2D" uid="uid://ddfp7u4a7llnr" path="res://textures/wall_side_tile_left.png" id="5_176r3"]
@ -154,20 +155,20 @@ animations = [{
}, { }, {
"frames": [{ "frames": [{
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_jo68p")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6gpfv") "texture": SubResource("AtlasTexture_6gpfv")
}, { }, {
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_yqhs4") "texture": SubResource("AtlasTexture_jo68p")
}, { }, {
"duration": 1.0, "duration": 1.0,
"texture": SubResource("AtlasTexture_fd1o3") "texture": SubResource("AtlasTexture_fd1o3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yqhs4")
}], }],
"loop": true, "loop": true,
"name": &"walk", "name": &"walk",
"speed": 6.0 "speed": 7.0
}] }]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_176r3"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_176r3"]
@ -200,7 +201,7 @@ shader = ExtResource("9_257nh")
shader_parameter/shake = 0.002000000095 shader_parameter/shake = 0.002000000095
shader_parameter/noiseQuality = 250.0 shader_parameter/noiseQuality = 250.0
shader_parameter/noiseIntensity = 0.0010000000475 shader_parameter/noiseIntensity = 0.0010000000475
shader_parameter/offsetIntensity = 0.0045 shader_parameter/offsetIntensity = 0.0
shader_parameter/colorOffsetIntensity = 0.10000000149012 shader_parameter/colorOffsetIntensity = 0.10000000149012
shader_parameter/pixelSize = 1024.0 shader_parameter/pixelSize = 1024.0
shader_parameter/grainIntensity = 0.04 shader_parameter/grainIntensity = 0.04
@ -220,6 +221,9 @@ autoplay = true
bus = &"Music" bus = &"Music"
parameters/looping = true parameters/looping = true
[node name="Dialogue" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_rncil")
[node name="Map" type="TileMapLayer" parent="."] [node name="Map" type="TileMapLayer" parent="."]
modulate = Color(0.53333336, 0.53333336, 0.53333336, 1) modulate = Color(0.53333336, 0.53333336, 0.53333336, 1)
material = SubResource("CanvasItemMaterial_gysiw") material = SubResource("CanvasItemMaterial_gysiw")
@ -383,6 +387,7 @@ text = "TO INTERACT"
label_settings = SubResource("LabelSettings_c2suo") label_settings = SubResource("LabelSettings_c2suo")
[node name="DialogueOptions" type="VBoxContainer" parent="UI/Control"] [node name="DialogueOptions" type="VBoxContainer" parent="UI/Control"]
visible = false
custom_minimum_size = Vector2(128, 0) custom_minimum_size = Vector2(128, 0)
layout_mode = 1 layout_mode = 1
anchors_preset = -1 anchors_preset = -1

View file

@ -2,9 +2,8 @@ extends Button
var game = null var game = null
func _on_pressed() -> void: func _on_pressed() -> void:
get_tree().quit() game.choice_made.emit(get_name())
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if has_focus() and (event.is_action_pressed("interact") or event.is_action_pressed("dialogue_continue")): if has_focus() and (event.is_action_pressed("interact") or event.is_action_pressed("dialogue_continue")):

View file

@ -11,10 +11,62 @@ func _interact(player: Node2D) -> void:
await game.dialogue("How may I help you?") await game.dialogue("How may I help you?")
await game.make_choice({ var option = await game.make_choice({
"refuel": "Refuel ship", "refuel": "Refuel ship",
"buy": "Buy items", "buy": "Buy items",
"exit": "Exit" "exit": "Exit"
}) })
if option == "refuel":
await game.dialogue("How much?")
var price_per_percentage = 0.433
var price_full = floori((100 - global.stats.fuel) * price_per_percentage)
var price_half = floori((50 - global.stats.fuel) * price_per_percentage)
var price_quarter = floori((25 - global.stats.fuel) * price_per_percentage)
var options = {
"full": "Refuel Tank (" + str(price_full)+ "¤)"
}
if price_half > 0:
options.half = "Refuel to 50% (" + str(price_half) + "¤)"
if price_quarter > 0:
options.quarter = "Refuel to 25% (" + str(price_quarter) + "¤)"
options.exit = "Nevermind"
var fuel_option = await game.make_choice(options)
if fuel_option == "full":
if price_full <= global.stats.marks:
global.stats.fuel = 100
global.stats.marks -= price_full
await game.dialogue("Okay, your tank should be filled to 100%.")
else:
await game.dialogue("Sorry, but you don't have enough marks for that.")
elif fuel_option == "half":
if price_half <= global.stats.marks:
global.stats.fuel = 50
global.stats.marks -= price_half
await game.dialogue("Okay, your tank should be filled to 50%.")
else:
await game.dialogue("Sorry, but you don't have enough marks for that.")
elif fuel_option == "quarter":
if price_quarter <= global.stats.marks:
global.stats.fuel = 25
global.stats.marks -= price_quarter
await game.dialogue("Okay, your tank should be filled to 25%.")
else:
await game.dialogue("Sorry, but you don't have enough marks for that.")
player.get_node("Camera").enabled = true
$Camera.enabled = false
$InteractArea.monitoring = true
player.busy = false
return return

View file

@ -29,7 +29,9 @@ func dialogue(text: String) -> void:
$UI/Control/Dialogue/Label.text = displayed_text $UI/Control/Dialogue/Label.text = displayed_text
await get_tree().create_timer(0.05).timeout $Dialogue.play()
await get_tree().create_timer(0.03).timeout
i += 1 i += 1
@ -41,11 +43,9 @@ func dialogue(text: String) -> void:
return return
func make_choice(options: Dictionary = {}) -> void: func make_choice(options: Dictionary = {}) -> String:
$UI/Control/DialogueOptions.visible = true $UI/Control/DialogueOptions.visible = true
$UI/Control/DialogueOptions/Button.grab_focus()
var dialogue_select_button_scene = preload("res://scenes/dialogue_select_button.tscn") var dialogue_select_button_scene = preload("res://scenes/dialogue_select_button.tscn")
for n in $UI/Control/DialogueOptions.get_children(): if n.is_class("Button"): n.free() for n in $UI/Control/DialogueOptions.get_children(): if n.is_class("Button"): n.free()
@ -58,6 +58,7 @@ func make_choice(options: Dictionary = {}) -> void:
dialogue_select_button.name = n dialogue_select_button.name = n
dialogue_select_button.text = options[n] dialogue_select_button.text = options[n]
dialogue_select_button.game = self
$UI/Control/DialogueOptions.add_child(dialogue_select_button) $UI/Control/DialogueOptions.add_child(dialogue_select_button)
@ -70,9 +71,12 @@ func make_choice(options: Dictionary = {}) -> void:
first_button.grab_focus() first_button.grab_focus()
await dialogue_continue var response = await choice_made
$UI/Control/DialogueOptions.visible = false
return response
return
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if event.is_action_pressed("dialogue_continue"): if event.is_action_pressed("dialogue_continue"):

View file

@ -22,3 +22,11 @@ var orbit_zones = [
}, },
] ]
var stats = {
"fuel": 12,
"fuel_tank_size": 1,
"speed": 512,
"boost_tank_size": 1,
"marks": 200,
}

BIN
sounds/dialogue.mp3 Normal file

Binary file not shown.

View file

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://cdl70q0x28717"
path="res://.godot/imported/dialogue.mp3-22f16b154a5459377efc48f8b6299007.mp3str"
[deps]
source_file="res://sounds/dialogue.mp3"
dest_files=["res://.godot/imported/dialogue.mp3-22f16b154a5459377efc48f8b6299007.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4