Двери, начальная реализация диалогов, обновление ресурсов
This commit is contained in:
parent
cf7f3bee5b
commit
aa948eb252
25 changed files with 755 additions and 74 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
*.csproj.old
|
||||
|
|
16
CREDITS.md
Normal file
16
CREDITS.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Credits
|
||||
|
||||
## Who made this game
|
||||
|
||||
- friendlywithmeat - coding
|
||||
- mrzuerg - graphics and level design
|
||||
|
||||
## Used resources
|
||||
|
||||
- zx spectrum font - Sizenko Alexander from [Style-7](http://www.styleseven.com)
|
||||
|
||||
## Tools
|
||||
|
||||
- Godot 4.3 with C#
|
||||
- Jetbrains Rider
|
||||
- Aseprite
|
40
Node2d.cs
Normal file
40
Node2d.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Node2d : CharacterBody2D
|
||||
{
|
||||
public const float Speed = 300.0f;
|
||||
public const float JumpVelocity = -400.0f;
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
Vector2 velocity = Velocity;
|
||||
|
||||
// Add the gravity.
|
||||
if (!IsOnFloor())
|
||||
{
|
||||
velocity += GetGravity() * (float)delta;
|
||||
}
|
||||
|
||||
// Handle Jump.
|
||||
if (Input.IsActionJustPressed("ui_accept") && IsOnFloor())
|
||||
{
|
||||
velocity.Y = JumpVelocity;
|
||||
}
|
||||
|
||||
// Get the input direction and handle the movement/deceleration.
|
||||
// As good practice, you should replace UI actions with custom gameplay actions.
|
||||
Vector2 direction = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down");
|
||||
if (direction != Vector2.Zero)
|
||||
{
|
||||
velocity.X = direction.X * Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed);
|
||||
}
|
||||
|
||||
Velocity = velocity;
|
||||
MoveAndSlide();
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Godot.NET.Sdk/4.2.2">
|
||||
<Project Sdk="Godot.NET.Sdk/4.3.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
|
||||
|
|
BIN
fonts/ZxSpectrum7-nROZ0.ttf
Normal file
BIN
fonts/ZxSpectrum7-nROZ0.ttf
Normal file
Binary file not shown.
39
fonts/ZxSpectrum7-nROZ0.ttf.import
Normal file
39
fonts/ZxSpectrum7-nROZ0.ttf.import
Normal file
|
@ -0,0 +1,39 @@
|
|||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://dwn20pw40jpxm"
|
||||
path="res://.godot/imported/ZxSpectrum7-nROZ0.ttf-7a86c6132238c7414185578e0f5656e5.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fonts/ZxSpectrum7-nROZ0.ttf"
|
||||
dest_files=["res://.godot/imported/ZxSpectrum7-nROZ0.ttf-7a86c6132238c7414185578e0f5656e5.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=0
|
||||
generate_mipmaps=false
|
||||
disable_embedded_bitmaps=true
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=false
|
||||
force_autohinter=false
|
||||
hinting=0
|
||||
subpixel_positioning=0
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[{
|
||||
"chars": [],
|
||||
"glyphs": [],
|
||||
"name": "Новая конфигурация",
|
||||
"size": Vector2i(16, 0)
|
||||
}]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
BIN
fonts/ZxSpectrum7Bold-1GpEB.ttf
Normal file
BIN
fonts/ZxSpectrum7Bold-1GpEB.ttf
Normal file
Binary file not shown.
34
fonts/ZxSpectrum7Bold-1GpEB.ttf.import
Normal file
34
fonts/ZxSpectrum7Bold-1GpEB.ttf.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="font_data_dynamic"
|
||||
type="FontFile"
|
||||
uid="uid://blrrssv7yvot2"
|
||||
path="res://.godot/imported/ZxSpectrum7Bold-1GpEB.ttf-90e16e9694eef89eadb4ded82bfb64ea.fontdata"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://fonts/ZxSpectrum7Bold-1GpEB.ttf"
|
||||
dest_files=["res://.godot/imported/ZxSpectrum7Bold-1GpEB.ttf-90e16e9694eef89eadb4ded82bfb64ea.fontdata"]
|
||||
|
||||
[params]
|
||||
|
||||
Rendering=null
|
||||
antialiasing=0
|
||||
generate_mipmaps=false
|
||||
disable_embedded_bitmaps=true
|
||||
multichannel_signed_distance_field=false
|
||||
msdf_pixel_range=8
|
||||
msdf_size=48
|
||||
allow_system_fallback=false
|
||||
force_autohinter=false
|
||||
hinting=0
|
||||
subpixel_positioning=0
|
||||
oversampling=0.0
|
||||
Fallbacks=null
|
||||
fallbacks=[]
|
||||
Compress=null
|
||||
compress=true
|
||||
preload=[]
|
||||
language_support={}
|
||||
script_support={}
|
||||
opentype_features={}
|
42
prefabs/Dialog.tscn
Normal file
42
prefabs/Dialog.tscn
Normal file
|
@ -0,0 +1,42 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://cmn7af4dsj8v2"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://dwn20pw40jpxm" path="res://fonts/ZxSpectrum7-nROZ0.ttf" id="1_e4s1h"]
|
||||
|
||||
[sub_resource type="Theme" id="Theme_gtdw8"]
|
||||
default_font = ExtResource("1_e4s1h")
|
||||
default_font_size = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tctyf"]
|
||||
bg_color = Color(0.532017, 0.646565, 0.382003, 1)
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_8nvov"]
|
||||
font = ExtResource("1_e4s1h")
|
||||
font_size = 10
|
||||
outline_color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="Dialog" type="PanelContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -544.0
|
||||
offset_bottom = -451.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
theme = SubResource("Theme_gtdw8")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_tctyf")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Test dialog"
|
||||
label_settings = SubResource("LabelSettings_8nvov")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "NPC name"
|
14
prefabs/Door.tscn
Normal file
14
prefabs/Door.tscn
Normal file
|
@ -0,0 +1,14 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://coogmsw6rsdun"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Door.cs" id="1_nwv7e"]
|
||||
[ext_resource type="PackedScene" uid="uid://x6pqolxtgwvy" path="res://prefabs/Interactable.tscn" id="1_yb42q"]
|
||||
|
||||
[node name="Door" type="Node2D"]
|
||||
script = ExtResource("1_nwv7e")
|
||||
|
||||
[node name="Interactable" parent="." instance=ExtResource("1_yb42q")]
|
||||
SpriteOffset = Vector2(0, -40)
|
||||
AreaRadius = 20.0
|
||||
|
||||
[connection signal="PlayerLeft" from="Interactable" to="." method="_on_interactable_player_left"]
|
||||
[connection signal="PlayerNearBy" from="Interactable" to="." method="_on_interactable_player_near_by"]
|
|
@ -1,12 +1,12 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://x6pqolxtgwvy"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Interactable.cs" id="1_4jn0u"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://bvnfvjn7am8tc" path="res://resources/sprites/key.tres" id="2_meac6"]
|
||||
[ext_resource type="Script" path="res://scripts/Interactable.cs" id="1_4ni08"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://bvnfvjn7am8tc" path="res://resources/sprites/key.tres" id="2_0s1fq"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_w4p6k"]
|
||||
|
||||
[node name="Interactable" type="Node2D"]
|
||||
script = ExtResource("1_4jn0u")
|
||||
script = ExtResource("1_4ni08")
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
||||
|
@ -15,7 +15,8 @@ shape = SubResource("CircleShape2D_w4p6k")
|
|||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
visible = false
|
||||
sprite_frames = ExtResource("2_meac6")
|
||||
scale = Vector2(0.5, 0.5)
|
||||
sprite_frames = ExtResource("2_0s1fq")
|
||||
autoplay = "default"
|
||||
frame = 1
|
||||
frame_progress = 0.336703
|
||||
|
|
18
prefabs/NPC.tscn
Normal file
18
prefabs/NPC.tscn
Normal file
|
@ -0,0 +1,18 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://c5ndo6b0unkst"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/NPC.cs" id="1_xeo83"]
|
||||
[ext_resource type="PackedScene" uid="uid://x6pqolxtgwvy" path="res://prefabs/Interactable.tscn" id="2_hcfxj"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://e8ybb7seykdx" path="res://resources/sprites/player/player.tres" id="2_x8mtv"]
|
||||
|
||||
[node name="Npc" type="Node2D"]
|
||||
script = ExtResource("1_xeo83")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = ExtResource("2_x8mtv")
|
||||
|
||||
[node name="Interactable" parent="." instance=ExtResource("2_hcfxj")]
|
||||
SpriteOffset = Vector2(0, -25)
|
||||
AreaRadius = 20.0
|
||||
|
||||
[connection signal="PlayerLeft" from="Interactable" to="." method="_on_interactable_player_left"]
|
||||
[connection signal="PlayerNearBy" from="Interactable" to="." method="_on_interactable_player_near_by"]
|
|
@ -1,21 +1,53 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dfdsnwub212o6"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://dfdsnwub212o6"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/Player.cs" id="1_68nsf"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://e8ybb7seykdx" path="res://resources/sprites/player/player.tres" id="1_be2ex"]
|
||||
[ext_resource type="FontFile" uid="uid://dwn20pw40jpxm" path="res://fonts/ZxSpectrum7-nROZ0.ttf" id="3_w5ojp"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmn7af4dsj8v2" path="res://prefabs/Dialog.tscn" id="4_owmws"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sed4o"]
|
||||
size = Vector2(20, 29)
|
||||
size = Vector2(22, 51)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_8jldp"]
|
||||
default_font = ExtResource("3_w5ojp")
|
||||
default_font_size = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_l7l8c"]
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
z_index = 10
|
||||
script = ExtResource("1_68nsf")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
sprite_frames = ExtResource("1_be2ex")
|
||||
frame_progress = 0.641559
|
||||
animation = &"walk"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 0.5)
|
||||
position = Vector2(0, -0.5)
|
||||
shape = SubResource("RectangleShape2D_sed4o")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
offset = Vector2(0, -20)
|
||||
zoom = Vector2(2, 2)
|
||||
|
||||
[node name="ChatLog" type="PanelContainer" parent="Camera2D"]
|
||||
offset_left = 160.0
|
||||
offset_top = -140.0
|
||||
offset_right = 276.0
|
||||
offset_bottom = 100.0
|
||||
theme = SubResource("Theme_8jldp")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_l7l8c")
|
||||
|
||||
[node name="HFlowContainer" type="VBoxContainer" parent="Camera2D/ChatLog"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Camera2D/ChatLog/HFlowContainer"]
|
||||
layout_mode = 2
|
||||
text = "Chat"
|
||||
|
||||
[node name="Dialog" parent="Camera2D/ChatLog/HFlowContainer" instance=ExtResource("4_owmws")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Dialog2" parent="Camera2D/ChatLog/HFlowContainer" instance=ExtResource("4_owmws")]
|
||||
layout_mode = 2
|
||||
|
|
|
@ -12,7 +12,7 @@ config_version=5
|
|||
|
||||
config/name="chill-jam-10"
|
||||
run/main_scene="res://scenes/test.tscn"
|
||||
config/features=PackedStringArray("4.2", "C#", "GL Compatibility")
|
||||
config/features=PackedStringArray("4.3", "C#", "GL Compatibility")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
@ -29,12 +29,12 @@ project/assembly_name="chill-jam-10"
|
|||
|
||||
move_right={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_left={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
move_up={
|
||||
|
@ -45,6 +45,20 @@ move_down={
|
|||
"deadzone": 0.5,
|
||||
"events": []
|
||||
}
|
||||
Interact={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
show_chat={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
2d/default_gravity=9800.0
|
||||
|
||||
[rendering]
|
||||
|
||||
|
|
BIN
resources/sprites/Sub/Sub.png
Normal file
BIN
resources/sprites/Sub/Sub.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 117 KiB |
|
@ -2,16 +2,16 @@
|
|||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b3brymekuuwkh"
|
||||
path="res://.godot/imported/mc-walk-side.png-a5332ee9ed87bd7d0e1a7707263121ef.ctex"
|
||||
uid="uid://b5baxx5o21qy1"
|
||||
path="res://.godot/imported/Sub.png-ebfb8b118769124e707231ad3147612a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/sprites/player/mc-walk-side.png"
|
||||
dest_files=["res://.godot/imported/mc-walk-side.png-a5332ee9ed87bd7d0e1a7707263121ef.ctex"]
|
||||
source_file="res://resources/sprites/Sub/Sub.png"
|
||||
dest_files=["res://.godot/imported/Sub.png-ebfb8b118769124e707231ad3147612a.ctex"]
|
||||
|
||||
[params]
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 635 B |
BIN
resources/sprites/player/player.png
Normal file
BIN
resources/sprites/player/player.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
34
resources/sprites/player/player.png.import
Normal file
34
resources/sprites/player/player.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c50svxafnldco"
|
||||
path="res://.godot/imported/player.png-bebb91e5c714faf81a7082ad25f1bd3c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://resources/sprites/player/player.png"
|
||||
dest_files=["res://.godot/imported/player.png-bebb91e5c714faf81a7082ad25f1bd3c.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
|
|
@ -1,36 +1,48 @@
|
|||
[gd_resource type="SpriteFrames" load_steps=8 format=3 uid="uid://e8ybb7seykdx"]
|
||||
[gd_resource type="SpriteFrames" load_steps=11 format=3 uid="uid://e8ybb7seykdx"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b3brymekuuwkh" path="res://resources/sprites/player/mc-walk-side.png" id="1_338ik"]
|
||||
[ext_resource type="Texture2D" uid="uid://c50svxafnldco" path="res://resources/sprites/player/player.png" id="1_dm8qi"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s7byu"]
|
||||
atlas = ExtResource("1_338ik")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1e4dj"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(0, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_654fl"]
|
||||
atlas = ExtResource("1_338ik")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_plu4p"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(64, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tdjd0"]
|
||||
atlas = ExtResource("1_338ik")
|
||||
region = Rect2(64, 0, 32, 32)
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2o31q"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(128, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xicac"]
|
||||
atlas = ExtResource("1_338ik")
|
||||
region = Rect2(96, 0, 32, 32)
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_12s7x"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(192, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b6h1b"]
|
||||
atlas = ExtResource("1_338ik")
|
||||
region = Rect2(128, 0, 32, 32)
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xohba"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(256, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ukomw"]
|
||||
atlas = ExtResource("1_338ik")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mtcky"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(320, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ru6d7"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(384, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6mglq"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(448, 0, 64, 64)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vm47t"]
|
||||
atlas = ExtResource("1_dm8qi")
|
||||
region = Rect2(512, 0, 64, 64)
|
||||
|
||||
[resource]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_s7byu")
|
||||
"texture": SubResource("AtlasTexture_1e4dj")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
|
@ -38,21 +50,30 @@ animations = [{
|
|||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_654fl")
|
||||
"texture": SubResource("AtlasTexture_plu4p")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_tdjd0")
|
||||
"texture": SubResource("AtlasTexture_2o31q")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xicac")
|
||||
"texture": SubResource("AtlasTexture_12s7x")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b6h1b")
|
||||
"texture": SubResource("AtlasTexture_xohba")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ukomw")
|
||||
"texture": SubResource("AtlasTexture_mtcky")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ru6d7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6mglq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vm47t")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 5.0
|
||||
"speed": 14.0
|
||||
}]
|
||||
|
|
154
scenes/test.tscn
154
scenes/test.tscn
|
@ -1,15 +1,153 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dwii5fob7qy7c"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://dwii5fob7qy7c"]
|
||||
|
||||
[ext_resource type="TileSet" uid="uid://pvri4kky8ok3" path="res://resources/sprites/tiles/QoL.tres" id="1_np3m5"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5baxx5o21qy1" path="res://resources/sprites/Sub/Sub.png" id="1_81pua"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfdsnwub212o6" path="res://prefabs/Player.tscn" id="2_mmd6a"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://e8ybb7seykdx" path="res://resources/sprites/player/player.tres" id="3_cqsbi"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5ndo6b0unkst" path="res://prefabs/NPC.tscn" id="3_cu4p0"]
|
||||
[ext_resource type="PackedScene" uid="uid://coogmsw6rsdun" path="res://prefabs/Door.tscn" id="4_22581"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_h0540"]
|
||||
size = Vector2(640, 24)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_i40av"]
|
||||
size = Vector2(25.5, 104)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3xi1q"]
|
||||
size = Vector2(25.5, 104)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_nl627"]
|
||||
size = Vector2(1697, 24)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_f1hcn"]
|
||||
size = Vector2(33.75, 199)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hgf7s"]
|
||||
size = Vector2(681, 24)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_3d2ji"]
|
||||
size = Vector2(2311, 24)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1dgo4"]
|
||||
size = Vector2(23, 302.5)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ogw0u"]
|
||||
size = Vector2(32.75, 104)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bafxi"]
|
||||
size = Vector2(640, 24)
|
||||
|
||||
[node name="Test" type="Node2D"]
|
||||
|
||||
[node name="TileMap" type="TileMap" parent="."]
|
||||
texture_filter = 1
|
||||
tile_set = ExtResource("1_np3m5")
|
||||
format = 2
|
||||
layer_0/tile_data = PackedInt32Array(0, 17, 0, 1, 17, 0, 65535, 17, 0, 2, 17, 0, 65534, 17, 0, 4, 17, 0, 3, 17, 0, 65533, 17, 0, 65532, 17, 0, -131065, 17, 0, -65529, 17, 0, 7, 17, 0, 6, 17, 0, 5, 17, 0, 65530, 17, 0, 65531, 17, 0, -6, 17, 0, -65542, 17, 0)
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("1_81pua")
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="Sprite2D"]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(560, 51)
|
||||
shape = SubResource("RectangleShape2D_h0540")
|
||||
|
||||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(232, 11)
|
||||
shape = SubResource("RectangleShape2D_i40av")
|
||||
|
||||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(889, 11)
|
||||
shape = SubResource("RectangleShape2D_3xi1q")
|
||||
|
||||
[node name="CollisionShape2D4" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(883, 171)
|
||||
shape = SubResource("RectangleShape2D_nl627")
|
||||
|
||||
[node name="CollisionShape2D5" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(34.875, 83.5)
|
||||
shape = SubResource("RectangleShape2D_f1hcn")
|
||||
|
||||
[node name="CollisionShape2D6" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(1727, 127)
|
||||
shape = SubResource("RectangleShape2D_3xi1q")
|
||||
|
||||
[node name="CollisionShape2D7" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(1397, 51)
|
||||
shape = SubResource("RectangleShape2D_hgf7s")
|
||||
|
||||
[node name="CollisionShape2D8" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(1727, 5)
|
||||
shape = SubResource("RectangleShape2D_3xi1q")
|
||||
|
||||
[node name="CollisionShape2D9" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(1068, 5)
|
||||
shape = SubResource("RectangleShape2D_3xi1q")
|
||||
|
||||
[node name="CollisionShape2D10" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(576.5, 292)
|
||||
shape = SubResource("RectangleShape2D_3d2ji")
|
||||
|
||||
[node name="CollisionShape2D11" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(-568.5, 135.25)
|
||||
shape = SubResource("RectangleShape2D_1dgo4")
|
||||
|
||||
[node name="CollisionShape2D12" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(1540, 243)
|
||||
shape = SubResource("RectangleShape2D_3xi1q")
|
||||
|
||||
[node name="CollisionShape2D13" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(552.625, 246)
|
||||
shape = SubResource("RectangleShape2D_ogw0u")
|
||||
|
||||
[node name="CollisionShape2D14" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(231, 248)
|
||||
shape = SubResource("RectangleShape2D_i40av")
|
||||
|
||||
[node name="CollisionShape2D15" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(829, -268)
|
||||
shape = SubResource("RectangleShape2D_i40av")
|
||||
|
||||
[node name="CollisionShape2D16" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(1172, -268)
|
||||
shape = SubResource("RectangleShape2D_i40av")
|
||||
|
||||
[node name="CollisionShape2D17" type="CollisionShape2D" parent="Sprite2D/StaticBody2D"]
|
||||
position = Vector2(1032, -221)
|
||||
shape = SubResource("RectangleShape2D_bafxi")
|
||||
|
||||
[node name="Npc" parent="." instance=ExtResource("3_cu4p0")]
|
||||
position = Vector2(752, 16)
|
||||
NPCName = "Test"
|
||||
Frames = ExtResource("3_cqsbi")
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_mmd6a")]
|
||||
position = Vector2(10, -15)
|
||||
position = Vector2(263, 14)
|
||||
Speed = 100.0
|
||||
|
||||
[node name="Door_3F" parent="." node_paths=PackedStringArray("Exit") instance=ExtResource("4_22581")]
|
||||
position = Vector2(788, 14)
|
||||
Exit = NodePath("../Door_3F2")
|
||||
|
||||
[node name="Door_3F2" parent="." node_paths=PackedStringArray("Exit") instance=ExtResource("4_22581")]
|
||||
position = Vector2(790, 134)
|
||||
Exit = NodePath("../Door_3F")
|
||||
|
||||
[node name="Door_MEDBAY" parent="." node_paths=PackedStringArray("Exit") instance=ExtResource("4_22581")]
|
||||
position = Vector2(474, 134)
|
||||
Exit = NodePath("../Door_MEDBAY2")
|
||||
|
||||
[node name="Door_MEDBAY2" parent="." node_paths=PackedStringArray("Exit") instance=ExtResource("4_22581")]
|
||||
position = Vector2(474, 255)
|
||||
Exit = NodePath("../Door_MEDBAY")
|
||||
|
||||
[node name="Door_SONAR" parent="." node_paths=PackedStringArray("Exit") instance=ExtResource("4_22581")]
|
||||
position = Vector2(1180, 134)
|
||||
Exit = NodePath("../Door_SONAR2")
|
||||
|
||||
[node name="Door_SONAR2" parent="." node_paths=PackedStringArray("Exit") instance=ExtResource("4_22581")]
|
||||
position = Vector2(1179, 14)
|
||||
Exit = NodePath("../Door_SONAR")
|
||||
|
||||
[node name="Door_QUOTERS" parent="." node_paths=PackedStringArray("Exit") instance=ExtResource("4_22581")]
|
||||
position = Vector2(1436, 134)
|
||||
Exit = NodePath("../Door_QUOTERS2")
|
||||
|
||||
[node name="Door_QUOTERS2" parent="." node_paths=PackedStringArray("Exit") instance=ExtResource("4_22581")]
|
||||
position = Vector2(1442, 255)
|
||||
Exit = NodePath("../Door_QUOTERS")
|
||||
|
|
26
scripts/Door.cs
Normal file
26
scripts/Door.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Door : Node2D
|
||||
{
|
||||
[Export] public Door Exit;
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
|
||||
private void _on_interactable_player_near_by(Player player)
|
||||
{
|
||||
player.InteractableObjects.Add(this);
|
||||
}
|
||||
|
||||
private void _on_interactable_player_left(Player player)
|
||||
{
|
||||
player.InteractableObjects.Remove(this);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,11 @@ using System;
|
|||
|
||||
public partial class Interactable : Node2D
|
||||
{
|
||||
[Signal]
|
||||
public delegate void PlayerNearByEventHandler(Player player);
|
||||
[Signal]
|
||||
public delegate void PlayerLeftEventHandler(Player player);
|
||||
|
||||
[Export] public Vector2 SpriteOffset;
|
||||
[Export] public float AreaRadius;
|
||||
|
||||
|
@ -29,6 +34,7 @@ public partial class Interactable : Node2D
|
|||
if (body is Player player)
|
||||
{
|
||||
_sprite.Visible = true;
|
||||
EmitSignal(SignalName.PlayerNearBy, player);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,6 +43,7 @@ public partial class Interactable : Node2D
|
|||
if (body is Player player)
|
||||
{
|
||||
_sprite.Visible = false;
|
||||
EmitSignal(SignalName.PlayerLeft, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
47
scripts/NPC.cs
Normal file
47
scripts/NPC.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using Godot.Collections;
|
||||
|
||||
|
||||
public partial class NPC : Node2D
|
||||
{
|
||||
[Export] public string NPCName;
|
||||
[Export] public SpriteFrames Frames;
|
||||
[Export] public Array<string> DialogLines = new Array<string>();
|
||||
|
||||
private AnimatedSprite2D _sprite;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_sprite = (AnimatedSprite2D)FindChild("AnimatedSprite2D");
|
||||
_sprite.SpriteFrames = Frames;
|
||||
_sprite.Play("default");
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
|
||||
public void test()
|
||||
{
|
||||
if (_sprite.Animation == "walk")
|
||||
{
|
||||
_sprite.Play("default");
|
||||
}
|
||||
else
|
||||
{
|
||||
_sprite.Play("walk");
|
||||
}
|
||||
}
|
||||
|
||||
private void _on_interactable_player_near_by(Player player)
|
||||
{
|
||||
player.InteractableObjects.Add(this);
|
||||
}
|
||||
|
||||
|
||||
private void _on_interactable_player_left(Player player)
|
||||
{
|
||||
player.InteractableObjects.Remove(this);
|
||||
}
|
||||
}
|
|
@ -1,45 +1,202 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class Player : CharacterBody2D
|
||||
{
|
||||
[Export] public const float Speed = 300.0f;
|
||||
private const double TransitionTime = 0.5;
|
||||
private const double CameraTransitionTime = 0.25;
|
||||
public enum State
|
||||
{
|
||||
Normal,
|
||||
Transition,
|
||||
ReadChat
|
||||
}
|
||||
|
||||
private State _state;
|
||||
|
||||
[Export] public State CurrentState
|
||||
{
|
||||
get => _state;
|
||||
private set
|
||||
{
|
||||
_state = value;
|
||||
switch (_state)
|
||||
{
|
||||
case State.Normal:
|
||||
Visible = true;
|
||||
break;
|
||||
case State.Transition:
|
||||
Visible = false;
|
||||
break;
|
||||
case State.ReadChat:
|
||||
// ChatLog.Visible = !ChatLog.Visible;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Export] public float Speed = 300.0f;
|
||||
|
||||
// Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
public float Gravity = ProjectSettings.GetSetting("physics/2d/default_gravity").AsSingle();
|
||||
|
||||
protected AnimatedSprite2D Sprite;
|
||||
public List<Node2D> InteractableObjects = new List<Node2D>();
|
||||
|
||||
public Node2D InteractableObject
|
||||
{
|
||||
get
|
||||
{
|
||||
if (InteractableObjects.Count == 0) return null;
|
||||
var nearObj = InteractableObjects[0];
|
||||
var minDistance = (GlobalPosition - nearObj.GlobalPosition).Length();
|
||||
foreach (var obj in InteractableObjects)
|
||||
{
|
||||
var distance = (GlobalPosition - obj.GlobalPosition).Length();
|
||||
if (minDistance > distance)
|
||||
{
|
||||
minDistance = distance;
|
||||
nearObj = obj;
|
||||
}
|
||||
}
|
||||
|
||||
return nearObj;
|
||||
}
|
||||
}
|
||||
|
||||
protected AnimatedSprite2D Sprite;
|
||||
protected PanelContainer ChatLog;
|
||||
protected Camera2D Camera;
|
||||
|
||||
private Vector2 _newPosition;
|
||||
private double _currentTransitionTime = 0;
|
||||
private double _currentCameraTransitionTime = 0;
|
||||
private Vector2 _previousPosition;
|
||||
private Vector2 _nextPosition;
|
||||
private Vector2 _cameraDefaultPosition = new(0, -20);
|
||||
private Vector2 _cameraChatLogPosition = new(116, -20);
|
||||
public override void _Ready()
|
||||
{
|
||||
Sprite = (AnimatedSprite2D)FindChild("AnimatedSprite2D");
|
||||
ChatLog = (PanelContainer)FindChild("ChatLog");
|
||||
Camera = (Camera2D)FindChild("Camera2D");
|
||||
}
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
Vector2 velocity = Velocity;
|
||||
|
||||
// Get the input direction and handle the movement/deceleration.
|
||||
// As good practice, you should replace UI actions with custom gameplay actions.
|
||||
Vector2 direction = Input.GetVector("move_left", "move_right", "move_up", "move_down");
|
||||
if (direction != Vector2.Zero)
|
||||
switch (CurrentState)
|
||||
{
|
||||
velocity.X = direction.X * Speed;
|
||||
Sprite.Play("walk");
|
||||
Sprite.FlipH = direction.X switch
|
||||
case State.Normal:
|
||||
|
||||
if (Camera.Offset != _cameraDefaultPosition)
|
||||
{
|
||||
if (_currentCameraTransitionTime < CameraTransitionTime)
|
||||
{
|
||||
Camera.Offset = _cameraChatLogPosition.Lerp(_cameraDefaultPosition, (float)(_currentCameraTransitionTime * 1/CameraTransitionTime));
|
||||
_currentCameraTransitionTime += delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentCameraTransitionTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 velocity = Velocity;
|
||||
|
||||
// if (!IsOnFloor())
|
||||
// {
|
||||
// velocity += GetGravity() * (float)delta;
|
||||
// }
|
||||
//
|
||||
// if (IsOnFloor() && !Visible)
|
||||
// {
|
||||
// Visible = true;
|
||||
// }
|
||||
|
||||
Vector2 direction = Input.GetVector("move_left", "move_right", "move_up", "move_down");
|
||||
if (direction != Vector2.Zero)
|
||||
{
|
||||
velocity.X = direction.X * Speed;
|
||||
Sprite.Play("walk");
|
||||
Sprite.FlipH = direction.X switch
|
||||
{
|
||||
> 0 => false,
|
||||
< 0 => true,
|
||||
_ => Sprite.FlipH
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed);
|
||||
Sprite.Play("default");
|
||||
}
|
||||
|
||||
Velocity = velocity;
|
||||
MoveAndSlide();
|
||||
break;
|
||||
case State.Transition:
|
||||
if (_currentTransitionTime < TransitionTime)
|
||||
{
|
||||
GlobalPosition = _previousPosition.Lerp(_nextPosition, (float)(_currentTransitionTime * 1/TransitionTime));
|
||||
_currentTransitionTime += delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentTransitionTime = 0;
|
||||
CurrentState = State.Normal;
|
||||
}
|
||||
|
||||
break;
|
||||
case State.ReadChat:
|
||||
if (Camera.Offset != _cameraChatLogPosition)
|
||||
{
|
||||
if (_currentCameraTransitionTime < CameraTransitionTime)
|
||||
{
|
||||
Camera.Offset = _cameraDefaultPosition.Lerp(_cameraChatLogPosition, (float)(_currentCameraTransitionTime * 1/CameraTransitionTime));
|
||||
_currentCameraTransitionTime += delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
_currentCameraTransitionTime = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed("Interact"))
|
||||
{
|
||||
if (InteractableObject is NPC npc)
|
||||
{
|
||||
> 0 => false,
|
||||
< 0 => true,
|
||||
_ => Sprite.FlipH
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed);
|
||||
Sprite.Play("default");
|
||||
npc.test();
|
||||
}
|
||||
|
||||
if (InteractableObject is Door door)
|
||||
{
|
||||
_previousPosition = GlobalPosition;
|
||||
_nextPosition = door.Exit.GlobalPosition;
|
||||
CurrentState = State.Transition;
|
||||
}
|
||||
}
|
||||
|
||||
Velocity = velocity;
|
||||
MoveAndSlide();
|
||||
if (@event.IsActionPressed("show_chat"))
|
||||
{
|
||||
switch (CurrentState)
|
||||
{
|
||||
case State.Normal:
|
||||
CurrentState = State.ReadChat;
|
||||
break;
|
||||
case State.ReadChat:
|
||||
CurrentState = State.Normal;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue