Added Door

This commit is contained in:
2024-09-08 01:01:42 +03:00
parent 3442221e8a
commit 7f44b2cbc9
15 changed files with 564 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://6t8mu5aw88ph"
path="res://.godot/imported/Bar.png-2a963d9ef4e22bff344022b758c43289.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/images/Bar.png"
dest_files=["res://.godot/imported/Bar.png-2a963d9ef4e22bff344022b758c43289.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://duryoldxgqeih"
path="res://.godot/imported/Doors.png-782cf5f5a82da6cc4f15bdbbdcf23b59.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/images/Doors.png"
dest_files=["res://.godot/imported/Doors.png-782cf5f5a82da6cc4f15bdbbdcf23b59.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cueeywtu6xdbv"
path="res://.godot/imported/Fierd.png-092c69452f524e8b881046eb1e338a4a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/images/Fierd.png"
dest_files=["res://.godot/imported/Fierd.png-092c69452f524e8b881046eb1e338a4a.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b6wbb26dayco1"
path="res://.godot/imported/Forest.png-eced32701689f557fd9334c4e79682e6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/images/Forest.png"
dest_files=["res://.godot/imported/Forest.png-eced32701689f557fd9334c4e79682e6.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dhpkj7orafb2o"
path="res://.godot/imported/Items.png-c7d096b9e23f1f297839b86fe453a627.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/images/Items.png"
dest_files=["res://.godot/imported/Items.png-c7d096b9e23f1f297839b86fe453a627.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
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+34
View File
@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b25k72no5164n"
path="res://.godot/imported/Water.png-f5e2a635bfd1e23e1085ad643d6ba448.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/images/Water.png"
dest_files=["res://.godot/imported/Water.png-f5e2a635bfd1e23e1085ad643d6ba448.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
+76
View File
@@ -0,0 +1,76 @@
extends StaticBody2D
enum DoorType {BOTTOM_DOOR, TOP_DOOR}
@export var door_type: DoorType
enum DoorState {OPENED, CLOSED, OPENING, CLOSING}
@export var door_state: DoorState
var ANIMATIONS_BY_TYPE : Dictionary = {
DoorType.BOTTOM_DOOR: "bottom_door",
DoorType.TOP_DOOR: "top_door",
}
var ANIMATIONS_BY_STATE : Dictionary = {
DoorState.OPENED: "opened",
DoorState.CLOSED: "closed",
DoorState.OPENING: "opening",
DoorState.CLOSING: "closing",
}
signal opened()
signal closed()
func _init(type: DoorType = DoorType.BOTTOM_DOOR, state: DoorState = DoorState.OPENED) -> void:
door_type = type
door_state = state
func _ready() -> void:
play_animation()
func play_animation() -> void:
var animation = "%s_%s" % [
ANIMATIONS_BY_TYPE[door_type],
ANIMATIONS_BY_STATE[door_state]
]
$AnimatedSprite2D.play(animation)
func open() -> void:
if door_state != DoorState.CLOSED:
print("Door in state '%s' can't be opened" % DoorState.find_key(door_state))
return
door_state = DoorState.OPENING
play_animation()
func close():
if door_state != DoorState.OPENED:
print("Door in state '%s' can't be closed" % DoorState.find_key(door_state))
return
door_state = DoorState.CLOSING
play_animation()
func _on_animated_sprite_2d_animation_finished() -> void:
if door_state == DoorState.CLOSING:
door_state = DoorState.CLOSED
$CollisionShape2D.disabled = false
play_animation()
elif door_state == DoorState.OPENING:
door_state = DoorState.OPENED
$CollisionShape2D.disabled = true
play_animation()
elif door_state == DoorState.CLOSED:
closed.emit()
elif door_state == DoorState.OPENED:
opened.emit()
+257
View File
@@ -0,0 +1,257 @@
[gd_scene load_steps=33 format=3 uid="uid://cp1y0n681kq8d"]
[ext_resource type="Script" path="res://door.gd" id="1_7rkx7"]
[ext_resource type="Texture2D" uid="uid://duryoldxgqeih" path="res://data/images/Doors.png" id="1_n81fa"]
[sub_resource type="AtlasTexture" id="AtlasTexture_k8y2b"]
atlas = ExtResource("1_n81fa")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_uvoha"]
atlas = ExtResource("1_n81fa")
region = Rect2(0, 48, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_vsyc3"]
atlas = ExtResource("1_n81fa")
region = Rect2(16, 32, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_hemfk"]
atlas = ExtResource("1_n81fa")
region = Rect2(0, 32, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_r6rnf"]
atlas = ExtResource("1_n81fa")
region = Rect2(16, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_uomvw"]
atlas = ExtResource("1_n81fa")
region = Rect2(0, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_imqt5"]
atlas = ExtResource("1_n81fa")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_il5p2"]
atlas = ExtResource("1_n81fa")
region = Rect2(48, 48, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_wwyt8"]
atlas = ExtResource("1_n81fa")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_2ty81"]
atlas = ExtResource("1_n81fa")
region = Rect2(0, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_bw5qr"]
atlas = ExtResource("1_n81fa")
region = Rect2(16, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_xl3ey"]
atlas = ExtResource("1_n81fa")
region = Rect2(0, 32, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_f0ok2"]
atlas = ExtResource("1_n81fa")
region = Rect2(16, 32, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_5y0qi"]
atlas = ExtResource("1_n81fa")
region = Rect2(0, 48, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_1vvyh"]
atlas = ExtResource("1_n81fa")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_bhlwq"]
atlas = ExtResource("1_n81fa")
region = Rect2(32, 48, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_0oxk5"]
atlas = ExtResource("1_n81fa")
region = Rect2(48, 32, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_31gdc"]
atlas = ExtResource("1_n81fa")
region = Rect2(32, 32, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_uy7ej"]
atlas = ExtResource("1_n81fa")
region = Rect2(48, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_1hu6a"]
atlas = ExtResource("1_n81fa")
region = Rect2(32, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_hvdtk"]
atlas = ExtResource("1_n81fa")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_cs53w"]
atlas = ExtResource("1_n81fa")
region = Rect2(48, 48, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jucfe"]
atlas = ExtResource("1_n81fa")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_ttpcv"]
atlas = ExtResource("1_n81fa")
region = Rect2(32, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_2d4ft"]
atlas = ExtResource("1_n81fa")
region = Rect2(48, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_vjey0"]
atlas = ExtResource("1_n81fa")
region = Rect2(32, 32, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_hm33r"]
atlas = ExtResource("1_n81fa")
region = Rect2(48, 32, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_tm71p"]
atlas = ExtResource("1_n81fa")
region = Rect2(32, 48, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_uucy3"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_k8y2b")
}],
"loop": false,
"name": &"bottom_door_closed",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_uvoha")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vsyc3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hemfk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_r6rnf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_uomvw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_imqt5")
}],
"loop": false,
"name": &"bottom_door_closing",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_il5p2")
}],
"loop": false,
"name": &"bottom_door_opened",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_wwyt8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2ty81")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bw5qr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xl3ey")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_f0ok2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5y0qi")
}],
"loop": false,
"name": &"bottom_door_opening",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_1vvyh")
}],
"loop": false,
"name": &"top_door_closed",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_bhlwq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0oxk5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_31gdc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_uy7ej")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1hu6a")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hvdtk")
}],
"loop": false,
"name": &"top_door_closing",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_cs53w")
}],
"loop": false,
"name": &"top_door_opened",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_jucfe")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ttpcv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2d4ft")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vjey0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hm33r")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tm71p")
}],
"loop": false,
"name": &"top_door_opening",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_notjl"]
size = Vector2(16, 16)
[node name="Door" type="StaticBody2D"]
script = ExtResource("1_7rkx7")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_uucy3")
animation = &"bottom_door_opened"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_notjl")
+27
View File
@@ -0,0 +1,27 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="Vegeconda"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"
[display]
window/size/viewport_width=2560
window/size/viewport_height=1440
window/size/resizable=false
window/stretch/scale=8.0
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"