Add tooltip component and integrate it into the scene; adjust audio volume for coin sound effect
This commit is contained in:
10
objects/audio_controller.tscn
Normal file
10
objects/audio_controller.tscn
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://dwi23csqy6d6m"]
|
||||
|
||||
[ext_resource type="AudioStream" uid="uid://bludculi5i6s" path="res://music/Cute RPG - Dreamy Dandelion (Loopable).ogg" id="1_fuc3i"]
|
||||
|
||||
[node name="AudioController" type="Node"]
|
||||
|
||||
[node name="Background Music" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource("1_fuc3i")
|
||||
autoplay = true
|
||||
parameters/looping = true
|
@@ -37,4 +37,4 @@ area2d = NodePath("..")
|
||||
|
||||
[node name="sfx" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource("5_4jc2c")
|
||||
volume_db = -5.0
|
||||
volume_db = -10.0
|
||||
|
54
objects/tooltip.tscn
Normal file
54
objects/tooltip.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://b4pdt1gv2ymyi"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/components/tooltip_component.gd" id="1_kkpqq"]
|
||||
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_yy7uq"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hkd8b"]
|
||||
size = Vector2(12, 17)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lqw6h"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="Tooltip" type="Area2D" node_paths=PackedStringArray("area2d", "ui_root", "tooltip_label")]
|
||||
collision_layer = 0
|
||||
collision_mask = 4
|
||||
script = ExtResource("1_kkpqq")
|
||||
area2d = NodePath(".")
|
||||
ui_root = NodePath("Panel")
|
||||
tooltip_label = NodePath("Panel/PanelContainer/Label")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -0.5)
|
||||
shape = SubResource("RectangleShape2D_hkd8b")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_yy7uq")
|
||||
hframes = 12
|
||||
vframes = 12
|
||||
frame = 53
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
offset_left = -66.0
|
||||
offset_top = -59.0
|
||||
offset_right = 67.0
|
||||
offset_bottom = -14.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_lqw6h")
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="Panel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Panel/PanelContainer"]
|
||||
custom_minimum_size = Vector2(32, 8)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
theme_override_font_sizes/font_size = 8
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 3
|
||||
clip_text = true
|
@@ -29,6 +29,11 @@ config/icon="res://icon.svg"
|
||||
GameManager="*res://objects/game_manager.tscn"
|
||||
PhantomCameraManager="*res://addons/phantom_camera/scripts/managers/phantom_camera_manager.gd"
|
||||
GUIDE="*res://addons/guide/guide.gd"
|
||||
AudioController="*res://objects/audio_controller.tscn"
|
||||
|
||||
[debug]
|
||||
|
||||
file_logging/enable_file_logging=true
|
||||
|
||||
[display]
|
||||
|
||||
|
@@ -1,8 +1,10 @@
|
||||
[gd_scene load_steps=35 format=4 uid="uid://h60obxmju6mo"]
|
||||
[gd_scene load_steps=37 format=4 uid="uid://h60obxmju6mo"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://djifxc5x0dyrw" path="res://sprites/ppc_tileset.png" id="1_5lb42"]
|
||||
[ext_resource type="TileSet" uid="uid://cl4bn8lofqvky" path="res://tileset/village/tileset_village.tres" id="1_d680t"]
|
||||
[ext_resource type="PackedScene" uid="uid://byxf45ukq82pe" path="res://objects/hud.tscn" id="1_gbpkv"]
|
||||
[ext_resource type="PackedScene" uid="uid://dyp4i4ru2j2jh" path="res://objects/explosion_fx.tscn" id="1_iqo0b"]
|
||||
[ext_resource type="PackedScene" uid="uid://dx80ivlvuuew4" path="res://objects/fire_fx.tscn" id="2_h1oxb"]
|
||||
[ext_resource type="PackedScene" uid="uid://54w4wisfj8v8" path="res://objects/coin.tscn" id="3_ygehw"]
|
||||
[ext_resource type="PackedScene" uid="uid://bqi5s710xb1ju" path="res://objects/brick_player.tscn" id="4_hetw8"]
|
||||
[ext_resource type="PackedScene" uid="uid://bargnp4twtmxg" path="res://objects/big_coin.tscn" id="5_bpga1"]
|
||||
@@ -22,7 +24,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://bqom4cm7r18db" path="res://objects/killzone.tscn" id="20_8a4vc"]
|
||||
[ext_resource type="PackedScene" uid="uid://dlm2ri562fynd" path="res://objects/marketplace.tscn" id="20_ss8k0"]
|
||||
[ext_resource type="PackedScene" uid="uid://d0s2abysa86rq" path="res://objects/child.tscn" id="21_8rhdx"]
|
||||
[ext_resource type="AudioStream" uid="uid://bludculi5i6s" path="res://music/Cute RPG - Dreamy Dandelion (Loopable).ogg" id="23_sdibc"]
|
||||
[ext_resource type="PackedScene" uid="uid://b4pdt1gv2ymyi" path="res://objects/tooltip.tscn" id="25_ckf05"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_cagp7"]
|
||||
texture = ExtResource("1_5lb42")
|
||||
@@ -473,6 +475,12 @@ ease = 2
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
|
||||
[node name="ExplosionFX" parent="." instance=ExtResource("1_iqo0b")]
|
||||
visible = false
|
||||
|
||||
[node name="FireFX" parent="." instance=ExtResource("2_h1oxb")]
|
||||
visible = false
|
||||
|
||||
[node name="Background Layer" type="TileMapLayer" parent="."]
|
||||
tile_map_data = PackedByteArray("AABjAAUAAAAKAAUAAABkAAUAAAAKAAUAAABlAAUAAAAKAAUAAABmAAUAAAAKAAUAAABnAAUAAAAKAAUAAABoAAUAAAAKAAUAAABpAAUAAAAKAAUAAABqAAUAAAAKAAUAAABrAAUAAAAKAAUAAABsAAUAAAAKAAUAAABjAAQAAAAJAAUAAABkAAQAAAAJAAUAAABlAAQAAAAJAAUAAABmAAQAAAAJAAUAAABnAAQAAAAJAAUAAABoAAQAAAAJAAUAAABpAAQAAAAJAAUAAABqAAQAAAAJAAUAAABrAAQAAAAJAAUAAABsAAQAAAAJAAUAAABtAAQAAAAJAAUAAABuAAQAAAAJAAUAAABvAAQAAAAJAAUAAABwAAQAAAAJAAUAAABxAAQAAAAJAAUAAAByAAQAAAAJAAUAAABzAAQAAAAJAAUAAAB0AAQAAAAJAAUAAAB1AAQAAAAJAAUAAAB2AAQAAAAJAAUAAAB3AAQAAAAJAAUAAAB4AAQAAAAJAAUAAAB5AAQAAAAJAAUAAAB6AAQAAAAJAAUAAAB7AAQAAAAJAAUAAAB8AAQAAAAJAAUAAAB8AAUAAAAKAAUAAAB7AAUAAAAKAAUAAAB6AAUAAAAKAAUAAAB5AAUAAAAKAAUAAAB4AAUAAAAKAAUAAAB3AAUAAAAKAAUAAAB2AAUAAAAKAAUAAAB1AAUAAAAKAAUAAAB0AAUAAAAKAAUAAABzAAUAAAAKAAUAAAByAAUAAAAKAAUAAABxAAUAAAAKAAUAAABwAAUAAAAKAAUAAABvAAUAAAAKAAUAAABuAAUAAAAKAAUAAABtAAUAAAAKAAUAAABjAAYAAAAKAAUAAABjAAcAAAAKAAUAAABkAAcAAAAKAAUAAABlAAcAAAAKAAUAAABmAAcAAAAKAAUAAABnAAcAAAAKAAUAAABoAAcAAAAKAAUAAABpAAcAAAAKAAUAAABqAAcAAAAKAAUAAABrAAcAAAAKAAUAAABsAAcAAAAKAAUAAABtAAcAAAAKAAUAAABuAAcAAAAKAAUAAABvAAcAAAAKAAUAAABwAAcAAAAKAAUAAABxAAcAAAAKAAUAAAByAAcAAAAKAAUAAABzAAcAAAAKAAUAAAB0AAcAAAAKAAUAAAB1AAcAAAAKAAUAAAB2AAcAAAAKAAUAAAB3AAcAAAAKAAUAAAB4AAcAAAAKAAUAAAB5AAcAAAAKAAUAAAB6AAcAAAAKAAUAAAB7AAcAAAAKAAUAAAB7AAYAAAAKAAUAAAB8AAYAAAAKAAUAAAB8AAcAAAAKAAUAAAB6AAYAAAAKAAUAAAB5AAYAAAAKAAUAAAB4AAYAAAAKAAUAAAB3AAYAAAAKAAUAAAB2AAYAAAAKAAUAAAB1AAYAAAAKAAUAAAB0AAYAAAAKAAUAAABzAAYAAAAKAAUAAAByAAYAAAAKAAUAAABxAAYAAAAKAAUAAABwAAYAAAAKAAUAAABvAAYAAAAKAAUAAABuAAYAAAAKAAUAAABtAAYAAAAKAAUAAABsAAYAAAAKAAUAAABrAAYAAAAKAAUAAABqAAYAAAAKAAUAAABpAAYAAAAKAAUAAABoAAYAAAAKAAUAAABnAAYAAAAKAAUAAABmAAYAAAAKAAUAAABlAAYAAAAKAAUAAABkAAYAAAAKAAUAAAA=")
|
||||
tile_set = SubResource("TileSet_7ri0q")
|
||||
@@ -519,6 +527,7 @@ position = Vector2(3710, 1)
|
||||
position = Vector2(3945, 33)
|
||||
|
||||
[node name="Brick Player" parent="." instance=ExtResource("4_hetw8")]
|
||||
z_index = 5
|
||||
position = Vector2(903, -118)
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
@@ -569,8 +578,12 @@ skill_unlocker = NodePath("../../Brick Player/SkillUnlockerComponent")
|
||||
[node name="Killzone" parent="." instance=ExtResource("20_8a4vc")]
|
||||
position = Vector2(0, 990)
|
||||
|
||||
[node name="Music" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource("23_sdibc")
|
||||
autoplay = true
|
||||
[node name="Tooltip" parent="." instance=ExtResource("25_ckf05")]
|
||||
position = Vector2(1016, -104)
|
||||
text = "Press 'down' to fall from platform!"
|
||||
|
||||
[node name="Tooltip2" parent="." instance=ExtResource("25_ckf05")]
|
||||
position = Vector2(1576, -40)
|
||||
text = "Be careful!"
|
||||
|
||||
[editable path="Brick Player"]
|
||||
|
42
scripts/components/tooltip_component.gd
Normal file
42
scripts/components/tooltip_component.gd
Normal file
@@ -0,0 +1,42 @@
|
||||
class_name TooltipComponent
|
||||
extends Node
|
||||
|
||||
@export var area2d: Area2D
|
||||
@export var ui_root: Control
|
||||
@export var text: String = ""
|
||||
@export var tooltip_label: Label
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if not area2d:
|
||||
printerr("Tooltip node missing Area2D child.")
|
||||
return
|
||||
|
||||
if not ui_root:
|
||||
printerr("Tooltip node missing UI root child.")
|
||||
return
|
||||
|
||||
if not tooltip_label:
|
||||
printerr("Tooltip node missing tooltip label child.")
|
||||
return
|
||||
|
||||
tooltip_label.text = text
|
||||
ui_root.visible = false
|
||||
area2d.body_entered.connect(_on_area2d_body_entered)
|
||||
area2d.body_exited.connect(_on_area2d_body_exited)
|
||||
|
||||
|
||||
func show_tooltip() -> void:
|
||||
ui_root.visible = true
|
||||
|
||||
|
||||
func hide_tooltip() -> void:
|
||||
ui_root.visible = false
|
||||
|
||||
|
||||
func _on_area2d_body_entered(_body: Node) -> void:
|
||||
show_tooltip()
|
||||
|
||||
|
||||
func _on_area2d_body_exited(_body: Node) -> void:
|
||||
hide_tooltip()
|
13
scripts/steam_integration.gd
Normal file
13
scripts/steam_integration.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
class_name SteamIntegration
|
||||
extends Node
|
||||
|
||||
var app_id: String = "3575090"
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
OS.set_environment("STEAM_APP_ID", app_id)
|
||||
OS.set_environment("STEAM_GAME_ID", app_id)
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
@@ -10,7 +10,7 @@ void fragment() {
|
||||
COLOR = texture(TEXTURE, UV);
|
||||
// Convert degrees to radians
|
||||
float angle_rad = radians(shine_angle_deg);
|
||||
|
||||
|
||||
// Calculate direction vector for the shine line
|
||||
vec2 shine_dir = vec2(cos(angle_rad), sin(angle_rad));
|
||||
|
||||
|
Reference in New Issue
Block a user