freettrpg/testing/test/player.tscn

42 lines
1.9 KiB
Text
Raw Normal View History

2024-06-14 09:44:34 +02:00
[gd_scene load_steps=4 format=3 uid="uid://dv67vdgb4h44q"]
2024-06-18 18:58:47 +02:00
# External resource for the player texture
2024-06-14 09:44:34 +02:00
[ext_resource type="Texture2D" uid="uid://dheqglouhkis6" path="res://testing/testAssets/player.png" id="1_cujcj"]
2024-06-18 18:58:47 +02:00
# External resource for the player script
2024-06-14 09:44:34 +02:00
[ext_resource type="Script" path="res://scripts/player.gd" id="1_oik63"]
2024-06-18 18:58:47 +02:00
# Sub-resource for the collision shape of the player
2024-06-14 09:44:34 +02:00
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kf6qt"]
2024-06-18 18:58:47 +02:00
size = Vector2(20, 18) # Setting the size of the RectangleShape2D
2024-06-14 09:44:34 +02:00
2024-06-18 18:58:47 +02:00
# Root node of the scene, a CharacterBody2D named "player"
2024-06-14 09:44:34 +02:00
[node name="player" type="CharacterBody2D"]
2024-06-18 18:58:47 +02:00
script = ExtResource("1_oik63") # Assigning the external script to the player node
2024-06-14 09:44:34 +02:00
2024-06-18 18:58:47 +02:00
# Child node of the player, a Sprite2D named "sprite"
2024-06-14 09:44:34 +02:00
[node name="sprite" type="Sprite2D" parent="."]
2024-06-18 18:58:47 +02:00
texture = ExtResource("1_cujcj") # Assigning the external texture to the sprite node
2024-06-14 09:44:34 +02:00
2024-06-18 18:58:47 +02:00
# Child node of the player, a CollisionShape2D named "CollisionShape2D"
2024-06-14 09:44:34 +02:00
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
2024-06-18 18:58:47 +02:00
shape = SubResource("RectangleShape2D_kf6qt") # Assigning the rectangle shape as the collision shape
2024-06-14 09:44:34 +02:00
2024-06-18 18:58:47 +02:00
# Child node of the player, a Camera2D named "camera"
2024-06-14 09:44:34 +02:00
[node name="camera" type="Camera2D" parent="."]
2024-06-18 18:58:47 +02:00
enabled = false # Camera is initially disabled
2024-06-18 18:58:47 +02:00
# Child node of the player, a Button named "stats"
[node name="stats" type="Button" parent="."]
2024-06-18 18:58:47 +02:00
visible = false # Button is initially invisible
offset_left = 112.0 # Left offset of the button
offset_top = 152.0 # Top offset of the button
offset_right = 238.0 # Right offset of the button
offset_bottom = 187.0 # Bottom offset of the button
scale = Vector2(2, 2) # Scaling the button by a factor of 2
disabled = true # Button is initially disabled
text = "Stats" # Text displayed on the button
# Connecting the "pressed" signal of the "stats" button to the "_on_stats_pressed" method in the current node
[connection signal="pressed" from="stats" to="." method="_on_stats_pressed"]