创建新工程
This commit is contained in:
39
scenes/Character.tscn
Normal file
39
scenes/Character.tscn
Normal file
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://character_base"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/CharacterController.gd" id="1"]
|
||||
|
||||
[node name="Character" type="CharacterBody2D"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
||||
[node name="Sprite" type="Node2D" parent="."]
|
||||
|
||||
[node name="Body" type="ColorRect" parent="Sprite"]
|
||||
offset_left = -16.0
|
||||
offset_top = -24.0
|
||||
offset_right = 16.0
|
||||
offset_bottom = 24.0
|
||||
color = Color(0.4, 0.6, 0.8, 1)
|
||||
|
||||
[node name="Head" type="ColorRect" parent="Sprite"]
|
||||
offset_left = -12.0
|
||||
offset_top = -32.0
|
||||
offset_right = 12.0
|
||||
offset_bottom = -16.0
|
||||
color = Color(0.9, 0.8, 0.7, 1)
|
||||
|
||||
[node name="NameLabel" type="Label" parent="."]
|
||||
offset_left = -40.0
|
||||
offset_top = -45.0
|
||||
offset_right = 40.0
|
||||
offset_bottom = -35.0
|
||||
text = "Character"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="StatusIndicator" type="ColorRect" parent="."]
|
||||
offset_left = 18.0
|
||||
offset_top = -30.0
|
||||
offset_right = 24.0
|
||||
offset_bottom = -24.0
|
||||
color = Color(0, 1, 0, 1)
|
||||
19
scenes/DatawhaleOffice.tscn
Normal file
19
scenes/DatawhaleOffice.tscn
Normal file
@@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://m3baykeq4xg8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://5wfrobimvgpr" path="res://scripts/DatawhaleOffice.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://scripts/DebugCamera.gd" id="2"]
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_0jecu"]
|
||||
|
||||
[node name="DatawhaleOffice" type="Node2D"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="."]
|
||||
tile_set = SubResource("TileSet_0jecu")
|
||||
format = 2
|
||||
|
||||
[node name="Characters" type="Node2D" parent="."]
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(640, 360)
|
||||
script = ExtResource("2")
|
||||
40
scenes/ErrorNotification.tscn
Normal file
40
scenes/ErrorNotification.tscn
Normal file
@@ -0,0 +1,40 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://error_notification"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/ErrorNotification.gd" id="1"]
|
||||
|
||||
[node name="ErrorNotification" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="NotificationPanel" type="Panel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_top = 20.0
|
||||
offset_bottom = 120.0
|
||||
grow_horizontal = 2
|
||||
|
||||
[node name="MessageLabel" type="Label" parent="NotificationPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 20.0
|
||||
offset_top = 10.0
|
||||
offset_right = -20.0
|
||||
offset_bottom = -10.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "错误消息"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
56
scenes/LoadingIndicator.tscn
Normal file
56
scenes/LoadingIndicator.tscn
Normal file
@@ -0,0 +1,56 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://loading_indicator"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/LoadingIndicator.gd" id="1"]
|
||||
|
||||
[node name="LoadingIndicator" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="LoadingPanel" type="Panel" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -150.0
|
||||
offset_top = -100.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 100.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="LoadingPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 20.0
|
||||
offset_top = 20.0
|
||||
offset_right = -20.0
|
||||
offset_bottom = -20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Spinner" type="ColorRect" parent="LoadingPanel/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
color = Color(0.4, 0.6, 1, 1)
|
||||
|
||||
[node name="LoadingLabel" type="Label" parent="LoadingPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "加载中..."
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="LoadingPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
max_value = 100.0
|
||||
show_percentage = false
|
||||
20
scenes/Main.tscn
Normal file
20
scenes/Main.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bvqxw8yh3qn7w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://o0k8pitjgwpm" path="res://scripts/Main.gd" id="1_main"]
|
||||
[ext_resource type="Script" uid="uid://bff86rwwknn3a" path="res://scripts/NetworkManager.gd" id="2_network"]
|
||||
[ext_resource type="Script" uid="uid://bi68fb55yixi3" path="res://scripts/GameStateManager.gd" id="3_gamestate"]
|
||||
[ext_resource type="Script" uid="uid://qef0lslx1f0d" path="res://scripts/UILayer.gd" id="4_uilayer"]
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1_main")
|
||||
|
||||
[node name="NetworkManager" type="Node" parent="."]
|
||||
script = ExtResource("2_network")
|
||||
|
||||
[node name="GameStateManager" type="Node" parent="."]
|
||||
script = ExtResource("3_gamestate")
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
script = ExtResource("4_uilayer")
|
||||
|
||||
[node name="GameWorld" type="Node2D" parent="."]
|
||||
20
scenes/Main.tscn1330543985.tmp
Normal file
20
scenes/Main.tscn1330543985.tmp
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bvqxw8yh3qn7w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://o0k8pitjgwpm" path="res://scripts/Main.gd" id="1_main"]
|
||||
[ext_resource type="Script" uid="uid://bff86rwwknn3a" path="res://scripts/NetworkManager.gd" id="2_network"]
|
||||
[ext_resource type="Script" uid="uid://bi68fb55yixi3" path="res://scripts/GameStateManager.gd" id="3_gamestate"]
|
||||
[ext_resource type="Script" uid="uid://qef0lslx1f0d" path="res://scripts/UILayer.gd" id="4_uilayer"]
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1_main")
|
||||
|
||||
[node name="NetworkManager" type="Node" parent="."]
|
||||
script = ExtResource("2_network")
|
||||
|
||||
[node name="GameStateManager" type="Node" parent="."]
|
||||
script = ExtResource("3_gamestate")
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
script = ExtResource("4_uilayer")
|
||||
|
||||
[node name="GameWorld" type="Node2D" parent="."]
|
||||
20
scenes/Main.tscn1702392861.tmp
Normal file
20
scenes/Main.tscn1702392861.tmp
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bvqxw8yh3qn7w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://o0k8pitjgwpm" path="res://scripts/Main.gd" id="1_main"]
|
||||
[ext_resource type="Script" uid="uid://bff86rwwknn3a" path="res://scripts/NetworkManager.gd" id="2_network"]
|
||||
[ext_resource type="Script" uid="uid://bi68fb55yixi3" path="res://scripts/GameStateManager.gd" id="3_gamestate"]
|
||||
[ext_resource type="Script" uid="uid://qef0lslx1f0d" path="res://scripts/UILayer.gd" id="4_uilayer"]
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1_main")
|
||||
|
||||
[node name="NetworkManager" type="Node" parent="."]
|
||||
script = ExtResource("2_network")
|
||||
|
||||
[node name="GameStateManager" type="Node" parent="."]
|
||||
script = ExtResource("3_gamestate")
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
script = ExtResource("4_uilayer")
|
||||
|
||||
[node name="GameWorld" type="Node2D" parent="."]
|
||||
20
scenes/Main.tscn1807234123.tmp
Normal file
20
scenes/Main.tscn1807234123.tmp
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bvqxw8yh3qn7w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://o0k8pitjgwpm" path="res://scripts/Main.gd" id="1_main"]
|
||||
[ext_resource type="Script" uid="uid://bff86rwwknn3a" path="res://scripts/NetworkManager.gd" id="2_network"]
|
||||
[ext_resource type="Script" uid="uid://bi68fb55yixi3" path="res://scripts/GameStateManager.gd" id="3_gamestate"]
|
||||
[ext_resource type="Script" uid="uid://qef0lslx1f0d" path="res://scripts/UILayer.gd" id="4_uilayer"]
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1_main")
|
||||
|
||||
[node name="NetworkManager" type="Node" parent="."]
|
||||
script = ExtResource("2_network")
|
||||
|
||||
[node name="GameStateManager" type="Node" parent="."]
|
||||
script = ExtResource("3_gamestate")
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
script = ExtResource("4_uilayer")
|
||||
|
||||
[node name="GameWorld" type="Node2D" parent="."]
|
||||
20
scenes/Main.tscn1852278133.tmp
Normal file
20
scenes/Main.tscn1852278133.tmp
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://bvqxw8yh3qn7w"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://o0k8pitjgwpm" path="res://scripts/Main.gd" id="1_main"]
|
||||
[ext_resource type="Script" uid="uid://bff86rwwknn3a" path="res://scripts/NetworkManager.gd" id="2_network"]
|
||||
[ext_resource type="Script" uid="uid://bi68fb55yixi3" path="res://scripts/GameStateManager.gd" id="3_gamestate"]
|
||||
[ext_resource type="Script" uid="uid://qef0lslx1f0d" path="res://scripts/UILayer.gd" id="4_uilayer"]
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1_main")
|
||||
|
||||
[node name="NetworkManager" type="Node" parent="."]
|
||||
script = ExtResource("2_network")
|
||||
|
||||
[node name="GameStateManager" type="Node" parent="."]
|
||||
script = ExtResource("3_gamestate")
|
||||
|
||||
[node name="UILayer" type="CanvasLayer" parent="."]
|
||||
script = ExtResource("4_uilayer")
|
||||
|
||||
[node name="GameWorld" type="Node2D" parent="."]
|
||||
38
scenes/PlayerCharacter.tscn
Normal file
38
scenes/PlayerCharacter.tscn
Normal file
@@ -0,0 +1,38 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://player_character"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/CharacterController.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://scripts/CharacterSprite.gd" id="2"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_player"]
|
||||
radius = 16.0
|
||||
|
||||
[node name="PlayerCharacter" type="CharacterBody2D"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_player")
|
||||
|
||||
[node name="CharacterSprite" type="Node2D" parent="."]
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
enabled = true
|
||||
zoom = Vector2(1.5, 1.5)
|
||||
position_smoothing_enabled = true
|
||||
position_smoothing_speed = 5.0
|
||||
|
||||
[node name="NameLabel" type="Label" parent="."]
|
||||
offset_left = -50.0
|
||||
offset_top = -50.0
|
||||
offset_right = 50.0
|
||||
offset_bottom = -30.0
|
||||
text = "Player"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="StatusIndicator" type="ColorRect" parent="."]
|
||||
offset_left = 18.0
|
||||
offset_top = -40.0
|
||||
offset_right = 26.0
|
||||
offset_bottom = -32.0
|
||||
color = Color(0.2, 1, 0.2, 0.8)
|
||||
32
scenes/RemoteCharacter.tscn
Normal file
32
scenes/RemoteCharacter.tscn
Normal file
@@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://remote_character"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/CharacterController.gd" id="1"]
|
||||
[ext_resource type="Script" path="res://scripts/CharacterSprite.gd" id="2"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_remote"]
|
||||
radius = 16.0
|
||||
|
||||
[node name="RemoteCharacter" type="CharacterBody2D"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_remote")
|
||||
|
||||
[node name="CharacterSprite" type="Node2D" parent="."]
|
||||
script = ExtResource("2")
|
||||
|
||||
[node name="NameLabel" type="Label" parent="."]
|
||||
offset_left = -50.0
|
||||
offset_top = -50.0
|
||||
offset_right = 50.0
|
||||
offset_bottom = -30.0
|
||||
text = "Remote"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="StatusIndicator" type="ColorRect" parent="."]
|
||||
offset_left = 18.0
|
||||
offset_top = -40.0
|
||||
offset_right = 26.0
|
||||
offset_bottom = -32.0
|
||||
color = Color(0.5, 0.5, 0.5, 0.6)
|
||||
13
scenes/TestGameplay.tscn
Normal file
13
scenes/TestGameplay.tscn
Normal file
@@ -0,0 +1,13 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://test_gameplay"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://m3baykeq4xg8" path="res://scenes/DatawhaleOffice.tscn" id="1"]
|
||||
[ext_resource type="PackedScene" uid="uid://player_character" path="res://scenes/PlayerCharacter.tscn" id="2"]
|
||||
[ext_resource type="Script" path="res://scripts/TestGameplay.gd" id="3"]
|
||||
|
||||
[node name="TestGameplay" type="Node"]
|
||||
script = ExtResource("3")
|
||||
|
||||
[node name="DatawhaleOffice" parent="." instance=ExtResource("1")]
|
||||
|
||||
[node name="PlayerCharacter" parent="DatawhaleOffice/Characters" instance=ExtResource("2")]
|
||||
position = Vector2(1000, 750)
|
||||
Reference in New Issue
Block a user