Compare commits
No commits in common. "main" and "0.0002" have entirely different histories.
5
.gitignore
vendored
|
|
@ -2,8 +2,5 @@
|
|||
.godot/
|
||||
.import/
|
||||
.mono/
|
||||
*.translation
|
||||
export_presets.cfg
|
||||
addons/
|
||||
android/
|
||||
build/
|
||||
android/
|
||||
|
Before Width: | Height: | Size: 27 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Buildings.png-770ff715356884b1c817297b61c9d391.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Assets/Buildings.png"
|
||||
dest_files=[ "res://.import/Buildings.png-770ff715356884b1c817297b61c9d391.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Hive.png-a7fa10a68a6ac7e64a951c5120ca919a.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Assets/Hive.png"
|
||||
dest_files=[ "res://.import/Hive.png-a7fa10a68a6ac7e64a951c5120ca919a.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Interior-01.png-5c49d1d4148443ce62e7ce8e2971cc4b.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Assets/Interior-01.png"
|
||||
dest_files=[ "res://.import/Interior-01.png-5c49d1d4148443ce62e7ce8e2971cc4b.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Props-Rocks.png-5fc44cb3261fb640ef6f4b399e25936d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Assets/Props-Rocks.png"
|
||||
dest_files=[ "res://.import/Props-Rocks.png-5fc44cb3261fb640ef6f4b399e25936d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 59 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Tiles.png-13228209615493c28b4ffdc1d443689f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Assets/Tiles.png"
|
||||
dest_files=[ "res://.import/Tiles.png-13228209615493c28b4ffdc1d443689f.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 30 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Tree-Assets.png-ddc68d744737f7a66e85f4d2594672c8.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Assets/Tree-Assets.png"
|
||||
dest_files=[ "res://.import/Tree-Assets.png-ddc68d744737f7a66e85f4d2594672c8.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 5.7 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Background.png-3958feb05652cfef811e8899a80f4b21.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Background/Background.png"
|
||||
dest_files=[ "res://.import/Background.png-3958feb05652cfef811e8899a80f4b21.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 15 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Base-01.png-e14dd8e752d14575f026a4d902d2c6d1.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/HUD/Base-01.png"
|
||||
dest_files=[ "res://.import/Base-01.png-e14dd8e752d14575f026a4d902d2c6d1.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 25 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Background.png-a121f2f8cdc5cc7f47f7eef3e48f2ea6.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Trees/Background.png"
|
||||
dest_files=[ "res://.import/Background.png-a121f2f8cdc5cc7f47f7eef3e48f2ea6.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 110 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Dark-Tree.png-ec5d91cebe262b341ca5e14c371992d1.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Trees/Dark-Tree.png"
|
||||
dest_files=[ "res://.import/Dark-Tree.png-ec5d91cebe262b341ca5e14c371992d1.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 132 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Golden-Tree.png-20c481574afe14f8f761d802692ea581.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Trees/Golden-Tree.png"
|
||||
dest_files=[ "res://.import/Golden-Tree.png-20c481574afe14f8f761d802692ea581.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 130 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Green-Tree.png-d2411d0125ab213d8ffa7bf9c74df92d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Trees/Green-Tree.png"
|
||||
dest_files=[ "res://.import/Green-Tree.png-d2411d0125ab213d8ffa7bf9c74df92d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 133 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Red-Tree.png-3708fbf3bca869e7647318f93e501cc0.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Trees/Red-Tree.png"
|
||||
dest_files=[ "res://.import/Red-Tree.png-3708fbf3bca869e7647318f93e501cc0.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 132 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Yellow-Tree.png-b7a2ad7318796ee49c166d8ef5238bf4.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/High Forest/Trees/Yellow-Tree.png"
|
||||
dest_files=[ "res://.import/Yellow-Tree.png-b7a2ad7318796ee49c166d8ef5238bf4.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
BIN
assets/Mega.png
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Spider1.png-85cc52177a93c8766bb76a39a26b9d70.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Spider1.png"
|
||||
dest_files=[ "res://.import/Spider1.png-85cc52177a93c8766bb76a39a26b9d70.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 41 KiB |
|
|
@ -1,144 +0,0 @@
|
|||
[gd_resource type="TileSet" load_steps=15 format=2]
|
||||
|
||||
[ext_resource path="res://assets/Tiles/Assets/Assets.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=2]
|
||||
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=3]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=4]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=5]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=6]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=7]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=8]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=9]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=10]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=11]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=12]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=13]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=14]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[resource]
|
||||
0/name = "Assets.png 0"
|
||||
0/texture = ExtResource( 1 )
|
||||
0/tex_offset = Vector2( 0, 0 )
|
||||
0/modulate = Color( 1, 1, 1, 1 )
|
||||
0/region = Rect2( 16, 0, 192, 96 )
|
||||
0/tile_mode = 2
|
||||
0/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
0/autotile/tile_size = Vector2( 16, 16 )
|
||||
0/autotile/spacing = 0
|
||||
0/autotile/occluder_map = [ ]
|
||||
0/autotile/navpoly_map = [ ]
|
||||
0/autotile/priority_map = [ ]
|
||||
0/autotile/z_index_map = [ ]
|
||||
0/occluder_offset = Vector2( 0, 0 )
|
||||
0/navigation_offset = Vector2( 0, 0 )
|
||||
0/shape_offset = Vector2( 0, 0 )
|
||||
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
0/shape = SubResource( 2 )
|
||||
0/shape_one_way = false
|
||||
0/shape_one_way_margin = 1.0
|
||||
0/shapes = [ {
|
||||
"autotile_coord": Vector2( 1, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 2 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 3 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 3, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 4 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 3, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 5 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 6 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 7 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 1, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 8 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 0, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 9 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 0, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 10 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 4, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 11 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 5, 3 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 12 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 8, 2 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 13 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 9, 2 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 14 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
0/z_index = 0
|
||||
|
Before Width: | Height: | Size: 5.6 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/Sprite-0002.png-7e0b22663bb9fd1f35794e30fe2058e2.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/Tiles/Assets/Sprite-0002.png"
|
||||
dest_files=[ "res://.import/Sprite-0002.png-7e0b22663bb9fd1f35794e30fe2058e2.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/elevator.png-acbb9d6b280a7beb809eaa023b52f90b.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/elevator.png"
|
||||
dest_files=[ "res://.import/elevator.png-acbb9d6b280a7beb809eaa023b52f90b.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 9.5 KiB |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/mmz1_door.png-bfbb77cdd4ff4c657c846885aecef8d7.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/mmz1_door.png"
|
||||
dest_files=[ "res://.import/mmz1_door.png-bfbb77cdd4ff4c657c846885aecef8d7.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 566 B |
|
|
@ -1,35 +0,0 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/quick_health.png-ab4d63b30abc1b0088589c308b6afa54.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/quick_health.png"
|
||||
dest_files=[ "res://.import/quick_health.png-ab4d63b30abc1b0088589c308b6afa54.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
process/normal_map_invert_y=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
205
export_presets.cfg
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
[preset.0]
|
||||
|
||||
name="Android"
|
||||
platform="Android"
|
||||
runnable=true
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=""
|
||||
script_export_mode=1
|
||||
script_encryption_key=""
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
custom_build/use_custom_build=false
|
||||
custom_build/export_format=0
|
||||
custom_build/min_sdk=""
|
||||
custom_build/target_sdk=""
|
||||
architectures/armeabi-v7a=true
|
||||
architectures/arm64-v8a=true
|
||||
architectures/x86=false
|
||||
architectures/x86_64=false
|
||||
keystore/debug=""
|
||||
keystore/debug_user=""
|
||||
keystore/debug_password=""
|
||||
keystore/release=""
|
||||
keystore/release_user=""
|
||||
keystore/release_password=""
|
||||
one_click_deploy/clear_previous_install=false
|
||||
version/code=1
|
||||
version/name="1.0"
|
||||
package/unique_name="org.godotengine.$genname"
|
||||
package/name=""
|
||||
package/signed=true
|
||||
package/classify_as_game=true
|
||||
package/retain_data_on_uninstall=false
|
||||
package/exclude_from_recents=false
|
||||
launcher_icons/main_192x192=""
|
||||
launcher_icons/adaptive_foreground_432x432=""
|
||||
launcher_icons/adaptive_background_432x432=""
|
||||
graphics/opengl_debug=false
|
||||
xr_features/xr_mode=0
|
||||
xr_features/hand_tracking=0
|
||||
xr_features/hand_tracking_frequency=0
|
||||
xr_features/passthrough=0
|
||||
screen/immersive_mode=true
|
||||
screen/support_small=true
|
||||
screen/support_normal=true
|
||||
screen/support_large=true
|
||||
screen/support_xlarge=true
|
||||
user_data_backup/allow=false
|
||||
command_line/extra_args=""
|
||||
apk_expansion/enable=false
|
||||
apk_expansion/SALT=""
|
||||
apk_expansion/public_key=""
|
||||
permissions/custom_permissions=PoolStringArray( )
|
||||
permissions/access_checkin_properties=false
|
||||
permissions/access_coarse_location=false
|
||||
permissions/access_fine_location=false
|
||||
permissions/access_location_extra_commands=false
|
||||
permissions/access_mock_location=false
|
||||
permissions/access_network_state=false
|
||||
permissions/access_surface_flinger=false
|
||||
permissions/access_wifi_state=false
|
||||
permissions/account_manager=false
|
||||
permissions/add_voicemail=false
|
||||
permissions/authenticate_accounts=false
|
||||
permissions/battery_stats=false
|
||||
permissions/bind_accessibility_service=false
|
||||
permissions/bind_appwidget=false
|
||||
permissions/bind_device_admin=false
|
||||
permissions/bind_input_method=false
|
||||
permissions/bind_nfc_service=false
|
||||
permissions/bind_notification_listener_service=false
|
||||
permissions/bind_print_service=false
|
||||
permissions/bind_remoteviews=false
|
||||
permissions/bind_text_service=false
|
||||
permissions/bind_vpn_service=false
|
||||
permissions/bind_wallpaper=false
|
||||
permissions/bluetooth=false
|
||||
permissions/bluetooth_admin=false
|
||||
permissions/bluetooth_privileged=false
|
||||
permissions/brick=false
|
||||
permissions/broadcast_package_removed=false
|
||||
permissions/broadcast_sms=false
|
||||
permissions/broadcast_sticky=false
|
||||
permissions/broadcast_wap_push=false
|
||||
permissions/call_phone=false
|
||||
permissions/call_privileged=false
|
||||
permissions/camera=false
|
||||
permissions/capture_audio_output=false
|
||||
permissions/capture_secure_video_output=false
|
||||
permissions/capture_video_output=false
|
||||
permissions/change_component_enabled_state=false
|
||||
permissions/change_configuration=false
|
||||
permissions/change_network_state=false
|
||||
permissions/change_wifi_multicast_state=false
|
||||
permissions/change_wifi_state=false
|
||||
permissions/clear_app_cache=false
|
||||
permissions/clear_app_user_data=false
|
||||
permissions/control_location_updates=false
|
||||
permissions/delete_cache_files=false
|
||||
permissions/delete_packages=false
|
||||
permissions/device_power=false
|
||||
permissions/diagnostic=false
|
||||
permissions/disable_keyguard=false
|
||||
permissions/dump=false
|
||||
permissions/expand_status_bar=false
|
||||
permissions/factory_test=false
|
||||
permissions/flashlight=false
|
||||
permissions/force_back=false
|
||||
permissions/get_accounts=false
|
||||
permissions/get_package_size=false
|
||||
permissions/get_tasks=false
|
||||
permissions/get_top_activity_info=false
|
||||
permissions/global_search=false
|
||||
permissions/hardware_test=false
|
||||
permissions/inject_events=false
|
||||
permissions/install_location_provider=false
|
||||
permissions/install_packages=false
|
||||
permissions/install_shortcut=false
|
||||
permissions/internal_system_window=false
|
||||
permissions/internet=false
|
||||
permissions/kill_background_processes=false
|
||||
permissions/location_hardware=false
|
||||
permissions/manage_accounts=false
|
||||
permissions/manage_app_tokens=false
|
||||
permissions/manage_documents=false
|
||||
permissions/manage_external_storage=false
|
||||
permissions/master_clear=false
|
||||
permissions/media_content_control=false
|
||||
permissions/modify_audio_settings=false
|
||||
permissions/modify_phone_state=false
|
||||
permissions/mount_format_filesystems=false
|
||||
permissions/mount_unmount_filesystems=false
|
||||
permissions/nfc=false
|
||||
permissions/persistent_activity=false
|
||||
permissions/process_outgoing_calls=false
|
||||
permissions/read_calendar=false
|
||||
permissions/read_call_log=false
|
||||
permissions/read_contacts=false
|
||||
permissions/read_external_storage=false
|
||||
permissions/read_frame_buffer=false
|
||||
permissions/read_history_bookmarks=false
|
||||
permissions/read_input_state=false
|
||||
permissions/read_logs=false
|
||||
permissions/read_phone_state=false
|
||||
permissions/read_profile=false
|
||||
permissions/read_sms=false
|
||||
permissions/read_social_stream=false
|
||||
permissions/read_sync_settings=false
|
||||
permissions/read_sync_stats=false
|
||||
permissions/read_user_dictionary=false
|
||||
permissions/reboot=false
|
||||
permissions/receive_boot_completed=false
|
||||
permissions/receive_mms=false
|
||||
permissions/receive_sms=false
|
||||
permissions/receive_wap_push=false
|
||||
permissions/record_audio=false
|
||||
permissions/reorder_tasks=false
|
||||
permissions/restart_packages=false
|
||||
permissions/send_respond_via_message=false
|
||||
permissions/send_sms=false
|
||||
permissions/set_activity_watcher=false
|
||||
permissions/set_alarm=false
|
||||
permissions/set_always_finish=false
|
||||
permissions/set_animation_scale=false
|
||||
permissions/set_debug_app=false
|
||||
permissions/set_orientation=false
|
||||
permissions/set_pointer_speed=false
|
||||
permissions/set_preferred_applications=false
|
||||
permissions/set_process_limit=false
|
||||
permissions/set_time=false
|
||||
permissions/set_time_zone=false
|
||||
permissions/set_wallpaper=false
|
||||
permissions/set_wallpaper_hints=false
|
||||
permissions/signal_persistent_processes=false
|
||||
permissions/status_bar=false
|
||||
permissions/subscribed_feeds_read=false
|
||||
permissions/subscribed_feeds_write=false
|
||||
permissions/system_alert_window=false
|
||||
permissions/transmit_ir=false
|
||||
permissions/uninstall_shortcut=false
|
||||
permissions/update_device_stats=false
|
||||
permissions/use_credentials=false
|
||||
permissions/use_sip=false
|
||||
permissions/vibrate=false
|
||||
permissions/wake_lock=false
|
||||
permissions/write_apn_settings=false
|
||||
permissions/write_calendar=false
|
||||
permissions/write_call_log=false
|
||||
permissions/write_contacts=false
|
||||
permissions/write_external_storage=false
|
||||
permissions/write_gservices=false
|
||||
permissions/write_history_bookmarks=false
|
||||
permissions/write_profile=false
|
||||
permissions/write_secure_settings=false
|
||||
permissions/write_settings=false
|
||||
permissions/write_sms=false
|
||||
permissions/write_social_stream=false
|
||||
permissions/write_sync_settings=false
|
||||
permissions/write_user_dictionary=false
|
||||
|
|
@ -24,36 +24,6 @@ _global_script_classes=[ {
|
|||
"language": "GDScript",
|
||||
"path": "res://src/components/Health_Component.gd"
|
||||
}, {
|
||||
"base": "Interactable",
|
||||
"class": "HealthPickup",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/Interactables/HealthPickup.gd"
|
||||
}, {
|
||||
"base": "Area2D",
|
||||
"class": "Interactable",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/templates/Interactable/Interactable_Component.gd"
|
||||
}, {
|
||||
"base": "Node2D",
|
||||
"class": "Interactable_Receiver",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/templates/Interactable/Interactable_Receiver.gd"
|
||||
}, {
|
||||
"base": "Node2D",
|
||||
"class": "Level",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/Level.gd"
|
||||
}, {
|
||||
"base": "Reference",
|
||||
"class": "ModifierProperties",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/state_modifier_properties.gd"
|
||||
}, {
|
||||
"base": "Node2D",
|
||||
"class": "Modifier_Receiver",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/components/Modifier_Receiver.gd"
|
||||
}, {
|
||||
"base": "Node",
|
||||
"class": "MovementComponent",
|
||||
"language": "GDScript",
|
||||
|
|
@ -79,7 +49,7 @@ _global_script_classes=[ {
|
|||
"language": "GDScript",
|
||||
"path": "res://src/state_machine_animated_actor.gd"
|
||||
}, {
|
||||
"base": "Reference",
|
||||
"base": "Node",
|
||||
"class": "StateModifier",
|
||||
"language": "GDScript",
|
||||
"path": "res://src/state_modifier.gd"
|
||||
|
|
@ -93,12 +63,6 @@ _global_script_class_icons={
|
|||
"Actor": "",
|
||||
"FrameSoundEffects": "",
|
||||
"HealthComponent": "",
|
||||
"HealthPickup": "",
|
||||
"Interactable": "",
|
||||
"Interactable_Receiver": "",
|
||||
"Level": "",
|
||||
"ModifierProperties": "",
|
||||
"Modifier_Receiver": "",
|
||||
"MovementComponent": "",
|
||||
"State": "",
|
||||
"StateAnimatedActor": "",
|
||||
|
|
@ -116,14 +80,12 @@ config/icon="res://icon.png"
|
|||
|
||||
[aseprite]
|
||||
|
||||
animation/layers/exclusion_pattern="_+"
|
||||
animation/layers/only_include_visible_layers_by_default=true
|
||||
animation/layers/exclusion_pattern="_"
|
||||
|
||||
[autoload]
|
||||
|
||||
PlayerInfo="*res://src/singleton_autoloads/PlayerInfo.gd"
|
||||
UiManager="*res://src/singleton_autoloads/UIManager.gd"
|
||||
LevelInfo="*res://src/singleton_autoloads/LevelInfo.gd"
|
||||
|
||||
[debug]
|
||||
|
||||
|
|
@ -221,7 +183,6 @@ dash_1={
|
|||
2d_physics/layer_6="EnemyHurtbox"
|
||||
2d_physics/layer_7="PlayerHitbox"
|
||||
2d_physics/layer_8="EnemyHitbox"
|
||||
2d_physics/layer_11="Climbable"
|
||||
|
||||
[mono]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,112 +0,0 @@
|
|||
[gd_scene load_steps=14 format=2]
|
||||
|
||||
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/components/Hitbox_Component.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Actors/Enemies/Spider/spider_movement_component.gd" type="Script" id=3]
|
||||
[ext_resource path="res://src/Actors/Enemies/Spider/states/move.gd" type="Script" id=4]
|
||||
[ext_resource path="res://src/Actors/Enemies/Spider/states/idle.gd" type="Script" id=5]
|
||||
|
||||
[sub_resource type="StreamTexture" id=1]
|
||||
load_path = "res://.import/Spider1.png-85cc52177a93c8766bb76a39a26b9d70.stex"
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 0, 26, 20, 26 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 0, 0, 20, 26 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 20, 0, 20, 26 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 40, 0, 20, 26 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=6]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 2 ) ],
|
||||
"loop": false,
|
||||
"name": "die",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [ SubResource( 3 ) ],
|
||||
"loop": false,
|
||||
"name": "idle",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
|
||||
"loop": false,
|
||||
"name": "jump",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [ SubResource( 5 ), SubResource( 4 ), SubResource( 3 ) ],
|
||||
"loop": false,
|
||||
"name": "land",
|
||||
"speed": 10.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=7]
|
||||
extents = Vector2( 10, 12 )
|
||||
|
||||
[sub_resource type="CircleShape2D" id=8]
|
||||
|
||||
[node name="Spider" instance=ExtResource( 1 )]
|
||||
actor_type = "Enemy"
|
||||
|
||||
[node name="AnimatedSprite" parent="." index="0"]
|
||||
frames = SubResource( 6 )
|
||||
animation = "jump"
|
||||
frame = 2
|
||||
__meta__ = {
|
||||
"_aseprite_wizard_config_": {
|
||||
"layer": "",
|
||||
"o_ex_p": "",
|
||||
"o_folder": "res://assets",
|
||||
"o_name": "",
|
||||
"only_visible": true,
|
||||
"op_exp": false,
|
||||
"slice": "",
|
||||
"source": "D:/Sync/Assets/Library/Spider1.ase"
|
||||
}
|
||||
}
|
||||
|
||||
[node name="movement_component" parent="." index="1"]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="movement_state_machine" parent="." index="2"]
|
||||
debug_state_machine = true
|
||||
|
||||
[node name="idle" parent="movement_state_machine" index="0"]
|
||||
script = ExtResource( 5 )
|
||||
timeout_seconds = 0.5
|
||||
animation_sequence = [ "idle" ]
|
||||
|
||||
[node name="fall" parent="movement_state_machine" index="1"]
|
||||
animation_sequence = [ "land" ]
|
||||
|
||||
[node name="move" parent="movement_state_machine" index="2"]
|
||||
script = ExtResource( 4 )
|
||||
animation_sequence = [ "jump" ]
|
||||
jump_force = 200.0
|
||||
|
||||
[node name="CollisionShape2D" parent="Hurtbox_Component" index="0"]
|
||||
position = Vector2( 0, -1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="5"]
|
||||
position = Vector2( 0, -2 )
|
||||
shape = SubResource( 7 )
|
||||
|
||||
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="." index="6"]
|
||||
position = Vector2( 0, 1 )
|
||||
|
||||
[node name="Hitbox_Component" parent="." index="7" instance=ExtResource( 2 )]
|
||||
damage_amount = 5
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox_Component" index="0"]
|
||||
position = Vector2( 0, -1 )
|
||||
shape = SubResource( 8 )
|
||||
|
||||
[connection signal="screen_entered" from="VisibilityNotifier2D" to="movement_component" method="_on_VisibilityNotifier2D_screen_entered"]
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
extends MovementComponent
|
||||
|
||||
## Constants available to you
|
||||
# UP = -1.0
|
||||
# DOWN = 1.0
|
||||
# LEFT = -1.0
|
||||
# RIGHT = 1.0
|
||||
|
||||
# Avalable functions to call
|
||||
# A Series of helper functions
|
||||
# go_up():
|
||||
# go_down():
|
||||
# go_left():
|
||||
# go_right():
|
||||
# stop():
|
||||
|
||||
var entered_screen = false
|
||||
var jump_var = false
|
||||
|
||||
var last_player_direction: float
|
||||
|
||||
func process(delta):
|
||||
if entered_screen:
|
||||
if current_movement_state == "idle":
|
||||
# Only check the player direction in idle because we don't want to track the player during jump
|
||||
if owner is Actor:
|
||||
last_player_direction = sign((owner.global_position.direction_to(PlayerInfo.player_position)).x)
|
||||
jump_var = true
|
||||
desired_movement_vector.x = last_player_direction
|
||||
else:
|
||||
desired_movement_vector.x = last_player_direction
|
||||
jump_var = false
|
||||
return
|
||||
|
||||
func wants_jump() -> bool:
|
||||
return jump_var
|
||||
|
||||
## Other needed variables
|
||||
# desired_movement_vector: Vector2 - Used to store desired movement depending on the state
|
||||
# current_movement_state:String - The name of the current State
|
||||
|
||||
# Since animactor state machine can actually view properties from this type
|
||||
# I'm thinking about moving the velocity tracker in here instead of player.
|
||||
# velocity: Vector2 - Current velocity, you can change this at will but state may modify it
|
||||
|
||||
# Declare any other member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
# you do not normally need to define this for Actor
|
||||
#func process(delta):
|
||||
# pass
|
||||
|
||||
# For Enemy and NPC Actors:
|
||||
# should be called on the frame process.
|
||||
|
||||
# For Player Actors:
|
||||
# Should be called on the input process
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_VisibilityNotifier2D_screen_entered():
|
||||
entered_screen = true
|
||||
print("Spider wants to play!!!")
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
extends "res://src/templates/Actor/states/idle.gd"
|
||||
|
||||
|
||||
func enter() -> void:
|
||||
.enter()
|
||||
# parent.set_hurtbox(true)
|
||||
move_component.velocity.x = 0
|
||||
state_timeout.start()
|
||||
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
|
||||
# parent.velocity.y += gravity * delta
|
||||
# #parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
# parent.velocity.x = move_component.desired_movement_vector.x * move_speed
|
||||
# parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
|
||||
if state_timeout.time_left == 0:
|
||||
move_actor_as_desired(delta)
|
||||
|
||||
if move_component.velocity.x != 0.0:
|
||||
return move_state
|
||||
|
||||
if !parent.is_on_floor():
|
||||
return fall_state
|
||||
return null
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
extends "res://src/templates/Actor/states/move.gd"
|
||||
|
||||
export var jump_force: float = 200.0
|
||||
|
||||
var landing_modifier: StateModifier
|
||||
|
||||
func _ready():
|
||||
landing_modifier= StateModifier.new()
|
||||
#add_child(modifier)
|
||||
#modifier.init_ref()
|
||||
landing_modifier.ready( "landing", "land" , landing_modifier.TYPE.EXIT_ANIMATION)
|
||||
#print("ready! MOD")
|
||||
|
||||
|
||||
func enter() -> void:
|
||||
.enter()
|
||||
# Apply initial jump velocity on state enter
|
||||
move_component.velocity.y = -jump_force
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
|
||||
# if move_component.velocity.y > 0:
|
||||
# return fall_state
|
||||
|
||||
# First allow horizontal movement.
|
||||
move_actor_as_desired(delta)
|
||||
|
||||
#Flip the character before tha actual move maybe.
|
||||
if move_component.get_movement_direction() != 0.0:
|
||||
parent.transform.x.x = move_component.get_movement_direction()
|
||||
|
||||
if parent.is_on_floor():
|
||||
idle_state.modifier = landing_modifier
|
||||
return idle_state
|
||||
|
||||
return null
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
[gd_scene load_steps=13 format=2]
|
||||
|
||||
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Actors/Platform/PlatformVMove/states/move.gd" type="Script" id=2]
|
||||
[ext_resource path="res://src/Actors/Platform/PlatformVMove/states/idle.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="StreamTexture" id=1]
|
||||
load_path = "res://.import/elevator.png-acbb9d6b280a7beb809eaa023b52f90b.stex"
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 0, 0, 86, 44 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 86, 0, 86, 44 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 172, 0, 86, 44 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 0, 44, 86, 44 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 86, 44, 86, 44 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
atlas = SubResource( 1 )
|
||||
region = Rect2( 172, 44, 86, 44 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=8]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=9]
|
||||
extents = Vector2( 38, 15.5 )
|
||||
|
||||
[node name="PlatformVMove" instance=ExtResource( 1 )]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
motion/sync_to_physics = true
|
||||
actor_type = "Object"
|
||||
|
||||
[node name="AnimatedSprite" parent="." index="0"]
|
||||
frames = SubResource( 8 )
|
||||
frame = 1
|
||||
__meta__ = {
|
||||
"_aseprite_wizard_config_": {
|
||||
"layer": "",
|
||||
"o_ex_p": "",
|
||||
"o_folder": "res://assets",
|
||||
"o_name": "",
|
||||
"only_visible": true,
|
||||
"op_exp": false,
|
||||
"slice": "",
|
||||
"source": "D:/Sync/Assets/Library/elevator.ase"
|
||||
}
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"]
|
||||
position = Vector2( 0, -3.5 )
|
||||
shape = SubResource( 9 )
|
||||
|
||||
[node name="idle" parent="movement_state_machine" index="0"]
|
||||
script = ExtResource( 3 )
|
||||
timeout_seconds = 2.0
|
||||
move_speed = 0.0
|
||||
|
||||
[node name="move" parent="movement_state_machine" index="2"]
|
||||
script = ExtResource( 2 )
|
||||
timeout_seconds = 1.0
|
||||
move_speed = 30.0
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
extends StateAnimatedActor
|
||||
|
||||
export (NodePath) var move_node
|
||||
|
||||
onready var move_state: State = get_node(move_node)
|
||||
|
||||
func enter() -> void:
|
||||
.enter()
|
||||
# parent.set_hurtbox(true)
|
||||
if debug_state:
|
||||
print(owner.name, " Move Component: ", move_component.desired_movement_vector.x)
|
||||
state_timeout.start()
|
||||
|
||||
func process_frame(delta):
|
||||
if state_timeout.time_left == 0:
|
||||
return move_state
|
||||
return null
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
|
||||
# parent.velocity.y += gravity * delta
|
||||
# #parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
# parent.velocity.x = move_component.desired_movement_vector.x * move_speed
|
||||
# parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
|
||||
return null
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
extends StateAnimatedActor
|
||||
|
||||
export (NodePath) var idle_node
|
||||
|
||||
onready var idle_state: State = get_node(idle_node)
|
||||
|
||||
var flip_flop:bool = false
|
||||
var recoil_velocity = Vector2.ZERO
|
||||
var max_recoil:float = 8.0
|
||||
|
||||
func enter() -> void:
|
||||
.enter()
|
||||
# parent.set_hurtbox(true)
|
||||
if debug_state:
|
||||
print(owner.name, " Move Component: ", move_component.desired_movement_vector.x)
|
||||
state_timeout.start()
|
||||
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
|
||||
if state_timeout.time_left == 0:
|
||||
if flip_flop:
|
||||
move_component.velocity.y = move_speed
|
||||
flip_flop = false
|
||||
return idle_state
|
||||
else:
|
||||
move_component.velocity.y = move_speed * - 1
|
||||
flip_flop = true
|
||||
return idle_state
|
||||
|
||||
#move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
||||
#var collision = parent.move_and_collide(move_component.velocity * delta, true, true, true)
|
||||
# var collision = parent.move_and_collide(Vector2.UP, true, true, true)
|
||||
#
|
||||
# if collision and recoil_velocity == Vector2.ZERO:
|
||||
# print("Get off me!")
|
||||
# recoil_velocity.y += max_recoil * delta
|
||||
|
||||
|
||||
# if collision and recoil_velocity == Vector2.ZERO:
|
||||
# print("Get off me!")
|
||||
# recoil_velocity.y += max_recoil * delta
|
||||
# else:
|
||||
# if recoil_velocity.y < max_recoil:
|
||||
# recoil_velocity.y -= max_recoil * delta
|
||||
# else:
|
||||
# recoil_velocity.y += max_recoil * delta
|
||||
# if recoil_velocity.y < 0:
|
||||
# recoil_velocity = Vector2.ZERO
|
||||
|
||||
#parent.global_translate(move_component.velocity * delta)
|
||||
|
||||
parent.position += (move_component.velocity + recoil_velocity) * delta
|
||||
|
||||
return null
|
||||
|
|
@ -4,36 +4,30 @@ export(String) var LINE_COLOR_HEX = '#FFEB3B'
|
|||
|
||||
var grid_position = Vector2()
|
||||
var grid_size = Vector2()
|
||||
var t = 0.0
|
||||
|
||||
onready var parent = PlayerInfo
|
||||
onready var timer: Timer = $Timer
|
||||
#onready var parent = $Player
|
||||
|
||||
##TODO: Quick and dirty because we need to pause these
|
||||
onready var player_node :KinematicBody2D = $"../Player"
|
||||
#onready var level_node = $"../Level"
|
||||
|
||||
func _ready():
|
||||
# If you drag the camera from the OffsetPivot node,
|
||||
# its position will not be (0, 0)
|
||||
#$Camera2D.global_position = Vector2(160,90) # when doing grid snapping
|
||||
#$Left.position = Vector2(160,90)
|
||||
#$Camera2D.position = Vector2(0,-4)
|
||||
$Camera2D.position = Vector2(0,-4)
|
||||
#grid_size = OS.get_screen_size()
|
||||
grid_size = get_node("/root").size
|
||||
#grid_size = get_node("/root").get_visible_rect().size
|
||||
print(grid_size)
|
||||
set_as_toplevel(true)
|
||||
#update_grid_position()
|
||||
##TODO: Can't seem to get first load grid snap not to happen.
|
||||
grid_position = calculate_grid_position()
|
||||
jump_to_grid_position()
|
||||
update_grid_position()
|
||||
print("Camera Set: ",grid_position, position)
|
||||
print("Ray Left: ", $Left.global_position, $Left.cast_to)
|
||||
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
t += delta * 0.4
|
||||
#print(parent.position.x)
|
||||
update_grid_position()
|
||||
#draw_line( Vector2(0, -half_line_length), Vector2(0, half_line_length), color, 3.0)
|
||||
|
|
@ -50,62 +44,13 @@ func update_grid_position():
|
|||
# print("Oh God! No!")
|
||||
# if grid_position == new_grid_position:
|
||||
# return
|
||||
# if the y value has changed we can flip transition the camera
|
||||
##TODO: this logic is working but I don't like it.
|
||||
if grid_position.y != new_grid_position.y:
|
||||
if !$Up.is_colliding() and grid_position.y > new_grid_position.y:
|
||||
get_tree().paused = true
|
||||
grid_position = new_grid_position
|
||||
timer.start()
|
||||
$Camera2D.smoothing_enabled = true
|
||||
jump_to_grid_position()
|
||||
#wait for stability.
|
||||
player_node.global_translate(Vector2(0,-10))
|
||||
var a_tenth_of_the_time = int((timer.time_left / timer.wait_time) * 10)
|
||||
while a_tenth_of_the_time != 0:
|
||||
#print(a_tenth_of_the_time)
|
||||
var time_ticks = int((timer.time_left / timer.wait_time) * 10)
|
||||
if time_ticks != a_tenth_of_the_time:
|
||||
print("Shifting Player Downward :", a_tenth_of_the_time)
|
||||
a_tenth_of_the_time = time_ticks
|
||||
player_node.global_translate(Vector2(0,-5))
|
||||
# WEIRD!? You have to add this at the end of a while loop or it gets stuck.
|
||||
yield(get_tree(), "idle_frame")
|
||||
#yield(timer, "timeout")
|
||||
$Camera2D.smoothing_enabled = false
|
||||
get_tree().paused = false
|
||||
elif !$Down.is_colliding() and grid_position.y < new_grid_position.y:
|
||||
get_tree().paused = true
|
||||
grid_position = new_grid_position
|
||||
timer.start()
|
||||
$Camera2D.smoothing_enabled = true
|
||||
jump_to_grid_position()
|
||||
# FINALLY Got one that works. I tried all sorts of stuff to move this thing!?
|
||||
var a_tenth_of_the_time = int((timer.time_left / timer.wait_time) * 10)
|
||||
while a_tenth_of_the_time != 0:
|
||||
#print(a_tenth_of_the_time)
|
||||
var time_ticks = int((timer.time_left / timer.wait_time) * 10)
|
||||
if time_ticks != a_tenth_of_the_time:
|
||||
print("Shifting Player Downward :", a_tenth_of_the_time)
|
||||
a_tenth_of_the_time = time_ticks
|
||||
player_node.global_translate(Vector2(0,2))
|
||||
# WEIRD!? You have to add this at the end of a while loop or it gets stuck.
|
||||
yield(get_tree(), "idle_frame")
|
||||
#yield(timer, "timeout")
|
||||
$Camera2D.smoothing_enabled = false
|
||||
get_tree().paused = false
|
||||
else:
|
||||
# Only allow horizontal camera moving
|
||||
grid_position.x = new_grid_position.x
|
||||
jump_to_grid_position()
|
||||
else:
|
||||
grid_position = new_grid_position
|
||||
jump_to_grid_position()
|
||||
grid_position = new_grid_position
|
||||
jump_to_grid_position()
|
||||
#$Left.position = Vector2(grid_position * grid_size)
|
||||
#print("Ray Left: ", $Left.global_position, $Left.cast_to)
|
||||
|
||||
|
||||
func calculate_grid_position() -> Vector2:
|
||||
func calculate_grid_position():
|
||||
# this needs to heavily round off the parents position
|
||||
var x_offset = floor(parent.player_position.x / grid_size.x)
|
||||
var y_offset = floor(parent.player_position.y / grid_size.y)
|
||||
|
|
@ -139,16 +84,6 @@ func jump_to_grid_position():
|
|||
$Camera2D.limit_right = $Right.get_collision_point().x
|
||||
else:
|
||||
$Camera2D.limit_right = 10000000
|
||||
|
||||
if $Up.is_colliding():
|
||||
$Camera2D.limit_top = $Up.get_collision_point().y
|
||||
else:
|
||||
$Camera2D.limit_top = -10000000
|
||||
if $Down.is_colliding():
|
||||
$Camera2D.limit_bottom = $Down.get_collision_point().y
|
||||
else:
|
||||
$Camera2D.limit_bottom = 10000000
|
||||
|
||||
position = Vector2( x_pos ,grid_position.y * grid_size.y)
|
||||
#$Camera2D.force_update_scroll()
|
||||
#position = Vector2( grid_position * grid_size)
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
extends Interactable
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
onready var sprite: Sprite = $Sprite
|
||||
|
||||
const pickup = preload("res://src/Interactables/HealthPickup.tscn")
|
||||
var opened := false
|
||||
|
||||
func trigger_interaction():
|
||||
# This is something that should maybe be extended for every differant interactible.
|
||||
# They could inherit from this base class and implement this function.
|
||||
sprite.frame = 1
|
||||
|
||||
if !opened:
|
||||
var chest_item = pickup.instance()
|
||||
chest_item.global_position = global_position + Vector2(0,-50)
|
||||
owner.add_child(chest_item)
|
||||
opened = true
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://src/templates/Interactable/Interactable_Component.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Interactables/Chest.gd" type="Script" id=2]
|
||||
[ext_resource path="res://assets/High Forest/Assets/Interior-01.png" type="Texture" id=3]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
|
||||
[node name="Chest" instance=ExtResource( 1 )]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="." index="0"]
|
||||
texture = ExtResource( 3 )
|
||||
vframes = 2
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 49, 80, 30, 64 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"]
|
||||
modulate = Color( 0.0313726, 1, 0, 1 )
|
||||
position = Vector2( 0, 3 )
|
||||
shape = SubResource( 1 )
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
extends Interactable
|
||||
|
||||
onready var door_animation: AnimatedSprite = $AnimatedSprite
|
||||
|
||||
func trigger_interaction():
|
||||
|
||||
door_animation.play("default")
|
||||
yield( door_animation, "animation_finished")
|
||||
$StaticBody2D/CollisionShape2D.disabled = true
|
||||
# This is something that should maybe be extended for every differant interactible.
|
||||
# They could inherit from this base class and implement this function.
|
||||
# sprite.frame = 1
|
||||
pass
|
||||
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
[gd_scene load_steps=15 format=2]
|
||||
|
||||
[ext_resource path="res://src/templates/Interactable/Interactable_Component.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/Interactables/Door.gd" type="Script" id=2]
|
||||
[ext_resource path="res://assets/mmz1_door.png" type="Texture" id=3]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 0, 0, 34, 94 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 34, 0, 34, 94 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 68, 0, 34, 94 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 102, 0, 34, 94 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 136, 0, 34, 94 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=6]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 170, 0, 34, 94 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=7]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 204, 0, 34, 94 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=8]
|
||||
atlas = ExtResource( 3 )
|
||||
region = Rect2( 238, 0, 34, 94 )
|
||||
|
||||
[sub_resource type="SpriteFrames" id=9]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ],
|
||||
"loop": false,
|
||||
"name": "default",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=10]
|
||||
extents = Vector2( 40, 21 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=11]
|
||||
extents = Vector2( 19, 39 )
|
||||
|
||||
[node name="Door" instance=ExtResource( 1 )]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"]
|
||||
frames = SubResource( 9 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"]
|
||||
modulate = Color( 0, 1, 0.0392157, 1 )
|
||||
shape = SubResource( 10 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="." index="2"]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D" index="0"]
|
||||
shape = SubResource( 11 )
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
class_name HealthPickup
|
||||
extends Interactable
|
||||
|
||||
|
||||
onready var health_icon: AnimatedSprite = $AnimatedSprite
|
||||
|
||||
onready var drop_raycast: RayCast2D = $RayCast2D
|
||||
|
||||
func _ready():
|
||||
#gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
gravity = 90
|
||||
# Doesn't get enabled until it drops
|
||||
monitoring = false
|
||||
|
||||
func _physics_process(delta):
|
||||
|
||||
if drop_raycast.is_colliding() == false:
|
||||
var velocity = Vector2(0,0)
|
||||
position.y += delta * gravity
|
||||
else:
|
||||
monitoring = true
|
||||
|
||||
func trigger_interaction():
|
||||
# This is something that should maybe be extended for every differant interactible.
|
||||
# They could inherit from this base class and implement this function.
|
||||
# sprite.frame = 1
|
||||
queue_free()
|
||||
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://src/Interactables/HealthPickup.gd" type="Script" id=1]
|
||||
[ext_resource path="res://src/templates/Interactable/Interactable_Component.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Interactables/QuickHealthPickup.tres" type="SpriteFrames" id=3]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=1]
|
||||
radius = 6.0
|
||||
|
||||
[node name="HealthPickup" instance=ExtResource( 2 )]
|
||||
monitoring = false
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="." index="0"]
|
||||
frames = ExtResource( 3 )
|
||||
frame = 2
|
||||
playing = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="1"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="RayCast2D" type="RayCast2D" parent="." index="2"]
|
||||
enabled = true
|
||||
cast_to = Vector2( 0, 8 )
|
||||
collision_mask = 3
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
[gd_resource type="SpriteFrames" load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://assets/quick_health.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 0, 0, 15, 13 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 15, 0, 15, 13 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 30, 0, 15, 13 )
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 45, 0, 15, 13 )
|
||||
|
||||
[resource]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
19
src/Level.gd
|
|
@ -1,19 +0,0 @@
|
|||
class_name Level
|
||||
extends Node2D
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
onready var player_start = $PlayerStart
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
LevelInfo.player_start_position = player_start
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://assets/Tiles/Assets/Demo TileSet.tres" type="TileSet" id=2]
|
||||
[ext_resource path="res://assets/Backgrounds/bgmuck.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/Tiles/Assets/Sprite-0002.png" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/Music/platformer_level03_loop.ogg" type="AudioStream" id=6]
|
||||
[ext_resource path="res://src/enemyC/EnemyC.tscn" type="PackedScene" id=7]
|
||||
|
||||
[sub_resource type="TileSet" id=1]
|
||||
|
||||
[sub_resource type="TileSet" id=2]
|
||||
0/name = "Sprite-0002.png 0"
|
||||
0/texture = ExtResource( 4 )
|
||||
0/tex_offset = Vector2( 0, 0 )
|
||||
0/modulate = Color( 1, 1, 1, 1 )
|
||||
0/region = Rect2( 0, 0, 144, 128 )
|
||||
0/tile_mode = 2
|
||||
0/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
0/autotile/tile_size = Vector2( 16, 16 )
|
||||
0/autotile/spacing = 0
|
||||
0/autotile/occluder_map = [ ]
|
||||
0/autotile/navpoly_map = [ ]
|
||||
0/autotile/priority_map = [ ]
|
||||
0/autotile/z_index_map = [ ]
|
||||
0/occluder_offset = Vector2( 0, 0 )
|
||||
0/navigation_offset = Vector2( 0, 0 )
|
||||
0/shape_offset = Vector2( 0, 0 )
|
||||
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
0/shape_one_way = false
|
||||
0/shape_one_way_margin = 0.0
|
||||
0/shapes = [ ]
|
||||
0/z_index = 0
|
||||
|
||||
[node name="Level" type="Node2D"]
|
||||
|
||||
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
||||
scroll_base_scale = Vector2( 0.4, 1 )
|
||||
scroll_limit_end = Vector2( 1300, 0 )
|
||||
|
||||
[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"]
|
||||
motion_mirroring = Vector2( 500, 0 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true,
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Bgmuck" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
|
||||
texture = ExtResource( 3 )
|
||||
centered = false
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Background TileMap" type="TileMap" parent="."]
|
||||
z_index = -1
|
||||
tile_set = SubResource( 1 )
|
||||
cell_size = Vector2( 16, 16 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( 47, 0, 327682, 48, 0, 327682, 49, 0, 327682, 50, 0, 327682, 51, 0, 327682, 52, 0, 327682, 65582, 0, 196608, 65583, 0, 327682, 65584, 0, 327682, 65585, 0, 327682, 65586, 0, 327682, 65587, 0, 327682, 65588, 0, 327682, 131118, 0, 196608, 131119, 0, 327683, 131120, 0, 327682, 131121, 0, 327683, 131122, 0, 327683, 131123, 0, 327683, 131124, 0, 327683, 196655, 0, 327683, 196656, 0, 327682, 196657, 0, 327682, 196658, 0, 327683, 196659, 0, 327683, 196660, 0, 327683, 262191, 0, 327682, 262192, 0, 327682, 262193, 0, 327683, 262194, 0, 327682, 262195, 0, 327682, 262196, 0, 327682, 327727, 0, 327683, 327728, 0, 327683, 327729, 0, 327683, 327730, 0, 327683, 327731, 0, 327682, 327732, 0, 327682, 393263, 0, 327682, 393264, 0, 327682, 393265, 0, 327683, 393266, 0, 327682, 393267, 0, 327682, 393268, 0, 327682, 458799, 0, 327682, 458800, 0, 327682, 458801, 0, 327682, 458802, 0, 327682, 458803, 0, 327682, 458804, 0, 327683, 524335, 0, 327682, 524336, 0, 327682, 524337, 0, 327683, 524338, 0, 327683, 524339, 0, 327683, 524340, 0, 327683, 589871, 0, 327682, 589872, 0, 327682, 589873, 0, 327683, 589874, 0, 327683, 589875, 0, 327683, 589876, 0, 327683 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Collision TileMap" type="TileMap" parent="."]
|
||||
tile_set = SubResource( 2 )
|
||||
cell_size = Vector2( 16, 16 )
|
||||
show_collision = true
|
||||
format = 1
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Foreground TileMap" type="TileMap" parent="."]
|
||||
z_index = 1
|
||||
tile_set = ExtResource( 2 )
|
||||
cell_size = Vector2( 16, 16 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( -131044, 0, 262152, -65508, 0, 262152, 28, 0, 262152, 44, 0, 262145, 45, 0, 262146, 46, 0, 262146, 47, 0, 262147, 65564, 0, 262152, 65581, 0, 327685, 65582, 0, 327686, 65583, 0, 327687, 131100, 0, 262152, 131118, 0, 327688, 196636, 0, 262152, 196654, 0, 327688, 262190, 0, 327688, 327726, 0, 327688, 393262, 0, 327688, 458798, 0, 327690, 589827, 0, 262148, 589828, 0, 262149, 589829, 0, 262149, 589830, 0, 262149, 589831, 0, 262151 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 6 )
|
||||
|
||||
[node name="EnemyC" parent="." instance=ExtResource( 7 )]
|
||||
position = Vector2( 394, 47 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="EnemyC2" parent="." instance=ExtResource( 7 )]
|
||||
position = Vector2( 492, 27 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="ActorTemplate" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 262, 44 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
actor_type = "NPC"
|
||||
|
|
@ -1,291 +0,0 @@
|
|||
[gd_scene load_steps=20 format=2]
|
||||
|
||||
[ext_resource path="res://src/Level.gd" type="Script" id=1]
|
||||
[ext_resource path="res://assets/Tiles/Assets/Demo TileSet.tres" type="TileSet" id=2]
|
||||
[ext_resource path="res://assets/High Forest/Background/Background.png" type="Texture" id=3]
|
||||
[ext_resource path="res://assets/High Forest/Assets/Tiles.png" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/Music/platformer_level03_loop.ogg" type="AudioStream" id=6]
|
||||
[ext_resource path="res://src/enemyC/EnemyC.tscn" type="PackedScene" id=7]
|
||||
|
||||
[sub_resource type="TileSet" id=1]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=13]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=14]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=16]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=17]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=18]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=19]
|
||||
points = PoolVector2Array( 0, 16, 16, 8.56219, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=20]
|
||||
points = PoolVector2Array( 0, 8.40067, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=21]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=22]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=23]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=24]
|
||||
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
|
||||
|
||||
[sub_resource type="TileSet" id=11]
|
||||
0/name = "Tiles.png 0"
|
||||
0/texture = ExtResource( 4 )
|
||||
0/tex_offset = Vector2( 0, 0 )
|
||||
0/modulate = Color( 1, 1, 1, 1 )
|
||||
0/region = Rect2( 0, 0, 80, 80 )
|
||||
0/tile_mode = 2
|
||||
0/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
0/autotile/tile_size = Vector2( 16, 16 )
|
||||
0/autotile/spacing = 0
|
||||
0/autotile/occluder_map = [ ]
|
||||
0/autotile/navpoly_map = [ ]
|
||||
0/autotile/priority_map = [ ]
|
||||
0/autotile/z_index_map = [ ]
|
||||
0/occluder_offset = Vector2( 0, 0 )
|
||||
0/navigation_offset = Vector2( 0, 0 )
|
||||
0/shape_offset = Vector2( 0, 0 )
|
||||
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
0/shape = SubResource( 13 )
|
||||
0/shape_one_way = false
|
||||
0/shape_one_way_margin = 1.0
|
||||
0/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 13 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 1, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 14 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 16 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 3, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 17 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 4, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 18 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
0/z_index = 0
|
||||
1/name = "Tiles.png 1"
|
||||
1/texture = ExtResource( 4 )
|
||||
1/tex_offset = Vector2( 0, 0 )
|
||||
1/modulate = Color( 1, 1, 1, 1 )
|
||||
1/region = Rect2( 0, 80, 80, 80 )
|
||||
1/tile_mode = 2
|
||||
1/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
1/autotile/tile_size = Vector2( 16, 16 )
|
||||
1/autotile/spacing = 0
|
||||
1/autotile/occluder_map = [ ]
|
||||
1/autotile/navpoly_map = [ ]
|
||||
1/autotile/priority_map = [ ]
|
||||
1/autotile/z_index_map = [ ]
|
||||
1/occluder_offset = Vector2( 0, 0 )
|
||||
1/navigation_offset = Vector2( 0, 0 )
|
||||
1/shape_offset = Vector2( 0, 0 )
|
||||
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
1/shape_one_way = false
|
||||
1/shape_one_way_margin = 0.0
|
||||
1/shapes = [ ]
|
||||
1/z_index = 0
|
||||
2/name = "Tiles.png 2"
|
||||
2/texture = ExtResource( 4 )
|
||||
2/tex_offset = Vector2( 0, 0 )
|
||||
2/modulate = Color( 1, 1, 1, 1 )
|
||||
2/region = Rect2( 80, 0, 64, 48 )
|
||||
2/tile_mode = 2
|
||||
2/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
2/autotile/tile_size = Vector2( 16, 16 )
|
||||
2/autotile/spacing = 0
|
||||
2/autotile/occluder_map = [ ]
|
||||
2/autotile/navpoly_map = [ ]
|
||||
2/autotile/priority_map = [ ]
|
||||
2/autotile/z_index_map = [ ]
|
||||
2/occluder_offset = Vector2( 0, 0 )
|
||||
2/navigation_offset = Vector2( 0, 0 )
|
||||
2/shape_offset = Vector2( 0, 0 )
|
||||
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
2/shape = SubResource( 19 )
|
||||
2/shape_one_way = false
|
||||
2/shape_one_way_margin = 1.0
|
||||
2/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 19 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 1, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 20 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
2/z_index = 0
|
||||
3/name = "Tiles.png 3"
|
||||
3/texture = ExtResource( 4 )
|
||||
3/tex_offset = Vector2( 0, 0 )
|
||||
3/modulate = Color( 1, 1, 1, 1 )
|
||||
3/region = Rect2( 64, 160, 96, 48 )
|
||||
3/tile_mode = 2
|
||||
3/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
3/autotile/tile_size = Vector2( 16, 16 )
|
||||
3/autotile/spacing = 0
|
||||
3/autotile/occluder_map = [ ]
|
||||
3/autotile/navpoly_map = [ ]
|
||||
3/autotile/priority_map = [ ]
|
||||
3/autotile/z_index_map = [ ]
|
||||
3/occluder_offset = Vector2( 0, 0 )
|
||||
3/navigation_offset = Vector2( 0, 0 )
|
||||
3/shape_offset = Vector2( 0, 0 )
|
||||
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
3/shape_one_way = false
|
||||
3/shape_one_way_margin = 0.0
|
||||
3/shapes = [ ]
|
||||
3/z_index = 0
|
||||
4/name = "Tiles.png 4"
|
||||
4/texture = ExtResource( 4 )
|
||||
4/tex_offset = Vector2( 0, 0 )
|
||||
4/modulate = Color( 1, 1, 1, 1 )
|
||||
4/region = Rect2( 80, 48, 48, 64 )
|
||||
4/tile_mode = 2
|
||||
4/autotile/icon_coordinate = Vector2( 0, 0 )
|
||||
4/autotile/tile_size = Vector2( 16, 16 )
|
||||
4/autotile/spacing = 0
|
||||
4/autotile/occluder_map = [ ]
|
||||
4/autotile/navpoly_map = [ ]
|
||||
4/autotile/priority_map = [ ]
|
||||
4/autotile/z_index_map = [ ]
|
||||
4/occluder_offset = Vector2( 0, 0 )
|
||||
4/navigation_offset = Vector2( 0, 0 )
|
||||
4/shape_offset = Vector2( 0, 0 )
|
||||
4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
4/shape = SubResource( 21 )
|
||||
4/shape_one_way = false
|
||||
4/shape_one_way_margin = 1.0
|
||||
4/shapes = [ {
|
||||
"autotile_coord": Vector2( 2, 1 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 21 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 0, 3 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 22 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 1, 3 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 23 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
}, {
|
||||
"autotile_coord": Vector2( 2, 3 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 24 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
4/z_index = 0
|
||||
|
||||
[node name="Level3" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
|
||||
scroll_base_scale = Vector2( 0.4, 1 )
|
||||
scroll_limit_end = Vector2( 1300, 0 )
|
||||
|
||||
[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"]
|
||||
motion_mirroring = Vector2( 500, 0 )
|
||||
__meta__ = {
|
||||
"_edit_group_": true,
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Bgmuck" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
|
||||
texture = ExtResource( 3 )
|
||||
centered = false
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Background TileMap" type="TileMap" parent="."]
|
||||
z_index = -1
|
||||
tile_set = SubResource( 1 )
|
||||
cell_size = Vector2( 16, 16 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( 47, 0, 327682, 48, 0, 327682, 49, 0, 327682, 50, 0, 327682, 51, 0, 327682, 52, 0, 327682, 65582, 0, 196608, 65583, 0, 327682, 65584, 0, 327682, 65585, 0, 327682, 65586, 0, 327682, 65587, 0, 327682, 65588, 0, 327682, 131118, 0, 196608, 131119, 0, 327683, 131120, 0, 327682, 131121, 0, 327683, 131122, 0, 327683, 131123, 0, 327683, 131124, 0, 327683, 196655, 0, 327683, 196656, 0, 327682, 196657, 0, 327682, 196658, 0, 327683, 196659, 0, 327683, 196660, 0, 327683, 262191, 0, 327682, 262192, 0, 327682, 262193, 0, 327683, 262194, 0, 327682, 262195, 0, 327682, 262196, 0, 327682, 327727, 0, 327683, 327728, 0, 327683, 327729, 0, 327683, 327730, 0, 327683, 327731, 0, 327682, 327732, 0, 327682, 393263, 0, 327682, 393264, 0, 327682, 393265, 0, 327683, 393266, 0, 327682, 393267, 0, 327682, 393268, 0, 327682, 458799, 0, 327682, 458800, 0, 327682, 458801, 0, 327682, 458802, 0, 327682, 458803, 0, 327682, 458804, 0, 327683, 524335, 0, 327682, 524336, 0, 327682, 524337, 0, 327683, 524338, 0, 327683, 524339, 0, 327683, 524340, 0, 327683, 589871, 0, 327682, 589872, 0, 327682, 589873, 0, 327683, 589874, 0, 327683, 589875, 0, 327683, 589876, 0, 327683 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Collision TileMap" type="TileMap" parent="."]
|
||||
tile_set = SubResource( 11 )
|
||||
cell_size = Vector2( 16, 16 )
|
||||
show_collision = true
|
||||
format = 1
|
||||
tile_data = PoolIntArray( 196636, 4, 131072, 196637, 4, 131073, 196638, 4, 131073, 196639, 4, 131073, 196640, 4, 131073, 196641, 4, 131073, 196642, 4, 131073, 196643, 4, 131074, 262172, 4, 196608, 262173, 4, 196609, 262174, 4, 196609, 262175, 4, 196609, 262176, 4, 196609, 262177, 4, 196609, 262178, 4, 196609, 262179, 4, 196610, 458770, 2, 1, 458771, 0, 1, 458772, 0, 2, 458773, 0, 3, 458774, 0, 1, 458775, 0, 2, 458776, 0, 3, 458777, 4, 2, 458778, 0, 1, 458779, 0, 2, 458780, 0, 3, 458781, 0, 1, 458782, 0, 2, 458783, 0, 3, 458784, 4, 2, 458785, 0, 1, 458786, 0, 2, 458787, 0, 3, 458788, 0, 1, 458789, 0, 2, 458790, 0, 3, 458791, 4, 2, 458792, 0, 4, 458796, 0, 3, 458797, 0, 1, 458798, 0, 2, 458799, 0, 3, 458800, 0, 1, 458801, 0, 2, 458802, 0, 3, 458803, 0, 1, 458804, 0, 2, 458805, 0, 3, 458806, 0, 1, 458807, 0, 2, 458808, 0, 3, 524304, 2, 1, 524305, 2, 65536, 524306, 2, 65537, 524307, 0, 65537, 524308, 0, 65538, 524309, 0, 65539, 524310, 0, 65537, 524311, 0, 65538, 524312, 0, 65539, 524313, 4, 65538, 524314, 0, 65537, 524315, 0, 65538, 524316, 0, 65539, 524317, 0, 65537, 524318, 0, 65538, 524319, 0, 65539, 524320, 4, 65538, 524321, 0, 65537, 524322, 0, 65538, 524323, 0, 65539, 524324, 0, 65537, 524325, 0, 65538, 524326, 0, 65539, 524327, 4, 65538, 524328, 0, 65540, 524332, 0, 65536, 524333, 0, 65537, 524334, 0, 65538, 524335, 0, 65539, 524336, 0, 65537, 524337, 0, 65538, 524338, 0, 65539, 524339, 0, 65537, 524340, 0, 65538, 524341, 0, 65539, 524342, 0, 65537, 524343, 0, 65538, 524344, 0, 65539, 589826, 0, 0, 589827, 0, 1, 589828, 0, 2, 589829, 0, 3, 589830, 0, 1, 589831, 0, 2, 589832, 0, 3, 589833, 0, 1, 589834, 0, 2, 589835, 0, 3, 589836, 0, 1, 589837, 0, 2, 589838, 0, 3, 589839, 2, 65536, 589840, 2, 65537, 589841, 2, 131072, 589842, 2, 131073, 589843, 0, 131073, 589844, 0, 131074, 589845, 0, 131075, 589846, 0, 131073, 589847, 0, 131074, 589848, 0, 131075, 589849, 0, 131074, 589850, 0, 131073, 589851, 0, 131074, 589852, 0, 131075, 589853, 0, 131073, 589854, 0, 131074, 589855, 0, 131075, 589856, 0, 131074, 589857, 0, 131073, 589858, 0, 131074, 589859, 0, 131075, 589860, 0, 131073, 589861, 0, 131074, 589862, 0, 131075, 589863, 0, 131074, 589864, 0, 131076, 589868, 0, 131072, 589869, 0, 131073, 589870, 0, 131074, 589871, 0, 131075, 589872, 0, 131073, 589873, 0, 131074, 589874, 0, 131075, 589875, 0, 131073, 589876, 0, 131074, 589877, 0, 131075, 589878, 0, 131073, 589879, 0, 131074, 589880, 0, 131075, 655362, 0, 65536, 655363, 0, 65537, 655364, 0, 65538, 655365, 0, 65539, 655366, 0, 65537, 655367, 0, 65538, 655368, 0, 65539, 655369, 0, 65537, 655370, 0, 65538, 655371, 0, 65539, 655372, 0, 65537, 655373, 0, 65538, 655374, 0, 65539, 655375, 2, 131072, 655376, 2, 131073, 655377, 4, 0, 655378, 4, 1, 655379, 0, 196610, 655380, 0, 196610, 655381, 0, 196610, 655382, 0, 196610, 655383, 0, 196610, 655384, 0, 196610, 655385, 0, 196610, 655386, 0, 196610, 655387, 0, 196610, 655388, 0, 196610, 655389, 0, 196610, 655390, 0, 196610, 655391, 0, 196610, 655392, 0, 196610, 655393, 0, 196610, 655394, 0, 196610, 655395, 0, 196610, 655396, 0, 196610, 655397, 0, 196610, 655398, 0, 196610, 655399, 0, 196610, 655400, 0, 196612, 655404, 0, 196608, 655405, 0, 196610, 655406, 0, 196610, 655407, 0, 196610, 655408, 0, 196610, 655409, 0, 196610, 655410, 0, 196610, 655411, 0, 196610, 655412, 0, 196610, 655413, 0, 196610, 655414, 0, 196610, 655415, 0, 196610, 655416, 0, 196610, 720898, 0, 131072, 720899, 0, 131073, 720900, 0, 131074, 720901, 0, 131075, 720902, 0, 131073, 720903, 0, 131074, 720904, 0, 131075, 720905, 0, 131073, 720906, 0, 131074, 720907, 0, 131075, 720908, 0, 131073, 720909, 0, 131074, 720910, 0, 131075, 720911, 4, 0, 720912, 4, 1, 720913, 0, 196610, 720914, 0, 196610, 720915, 0, 196610, 720916, 0, 196610, 720917, 0, 196610, 720918, 0, 196610, 720919, 0, 196610, 720920, 0, 196610, 720921, 0, 196610, 720922, 0, 196610, 720923, 0, 196610, 720924, 0, 196610, 720925, 0, 196610, 720926, 0, 196610, 720927, 0, 196610, 720928, 0, 196610, 720929, 0, 196610, 720930, 0, 196610, 720931, 0, 196610, 720932, 0, 196610, 720933, 0, 196610, 720934, 0, 196610, 720935, 0, 262147, 720936, 0, 262148, 720940, 0, 262144, 720941, 0, 262145, 720942, 0, 262146, 720943, 0, 262147, 720944, 0, 262145, 720945, 0, 262146, 720946, 0, 262147, 720947, 0, 262145, 720948, 0, 262146, 720949, 0, 262147, 720950, 0, 262145, 720951, 0, 262146, 720952, 0, 262147 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="Foreground TileMap" type="TileMap" parent="."]
|
||||
z_index = 1
|
||||
tile_set = ExtResource( 2 )
|
||||
cell_size = Vector2( 16, 16 )
|
||||
format = 1
|
||||
tile_data = PoolIntArray( -131044, 0, 262152, -65508, 0, 262152, 28, 0, 262152, 44, 0, 262145, 45, 0, 262146, 46, 0, 262146, 47, 0, 262147, 65564, 0, 262152, 65581, 0, 327685, 65582, 0, 327686, 65583, 0, 327687, 131100, 0, 262152, 131118, 0, 327688, 196636, 0, 262152, 196654, 0, 327688, 262190, 0, 327688, 327726, 0, 327688, 393262, 0, 327688, 458798, 0, 327690, 589827, 0, 262148, 589828, 0, 262149, 589829, 0, 262149, 589830, 0, 262149, 589831, 0, 262151 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 6 )
|
||||
|
||||
[node name="EnemyC" parent="." instance=ExtResource( 7 )]
|
||||
position = Vector2( 394, 47 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="EnemyC2" parent="." instance=ExtResource( 7 )]
|
||||
position = Vector2( 492, 27 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="EnemyC3" parent="." instance=ExtResource( 7 )]
|
||||
position = Vector2( 796, 89 )
|
||||
|
||||
[node name="PlayerStart" type="Position2D" parent="."]
|
||||
position = Vector2( 89, 103 )
|
||||
|
|
@ -34,7 +34,7 @@ func _ready():
|
|||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
$Debug.text = UiManager.debug_text
|
||||
|
||||
if (UiManager.current_pane != current_pane):
|
||||
print("UI Switch detected")
|
||||
current_pane = UiManager.current_pane
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ extends KinematicBody2D
|
|||
#var velocity = Vector2(0,0)
|
||||
#var direction = Vector2(-1,0)
|
||||
|
||||
export(String, "Player", "Enemy", "NPC", "Object") var actor_type
|
||||
export(String, "Player", "Enemy", "NPC") var actor_type
|
||||
#export var sprite_facing_right: bool = true
|
||||
export(Array, Resource) var SoundEffects
|
||||
export var debug_actor: bool = false
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
extends Area2D
|
||||
|
||||
|
||||
var modifier_type = 0
|
||||
|
||||
export var modifier_name :String = ''
|
||||
var animation_name: String = '' # Not using this one
|
||||
var timeout_seconds: float = 0.0 # Not doing timeout based ones yet either.
|
||||
|
||||
export var directional_modifier: bool = false
|
||||
|
||||
export var move_speed: float = 0.0
|
||||
export var move_acceleration: float = 0.0
|
||||
export var move_speed_modifier: float = 0.0
|
||||
export var move_modifier_move_acceleration: float = 0.0
|
||||
export var jerk_factor: float = 0
|
||||
|
||||
export var gravity_modifier: int = 0
|
||||
|
||||
#var state_timeout: Timer
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
var modifier :StateModifier
|
||||
#var modifier_properties: ModifierProperties
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
modifier = StateModifier.new()
|
||||
modifier.ready( modifier_name, animation_name , modifier.TYPE.NONE, timeout_seconds)
|
||||
modifier.modifier_properties = ModifierProperties.new( move_speed,
|
||||
gravity_modifier,
|
||||
move_acceleration,
|
||||
move_speed_modifier,
|
||||
move_modifier_move_acceleration,
|
||||
jerk_factor)
|
||||
print("Debug Direction property shy are you stopid?! ", directional_modifier)
|
||||
modifier.modifier_properties.directional_modifier = directional_modifier
|
||||
|
||||
func _on_Modifier_Component_body_entered(body):
|
||||
var colliding_node = body
|
||||
if colliding_node.has_node("Modifier_Receiver"):
|
||||
colliding_node.get_node("Modifier_Receiver").register_modifier(modifier)
|
||||
|
||||
|
||||
func _on_Modifier_Component_body_exited(body):
|
||||
var colliding_node = body
|
||||
if colliding_node.has_node("Modifier_Receiver"):
|
||||
colliding_node.get_node("Modifier_Receiver").remove_modifier(modifier)
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://src/components/Modifier_Component.gd" type="Script" id=1]
|
||||
|
||||
[node name="Modifier_Component" type="Area2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_Modifier_Component_body_entered"]
|
||||
[connection signal="body_exited" from="." to="." method="_on_Modifier_Component_body_exited"]
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
class_name Modifier_Receiver
|
||||
extends Node2D
|
||||
|
||||
# This may be stupid but we're going to have two kinds of callbacks here.
|
||||
# It's going to be up to the parent/actor/kinematicbody2d/whatever to know
|
||||
# what conditions have to be met before being able to call that interactible's
|
||||
# function.
|
||||
# This is a nice and generic interface that I might be able to use for
|
||||
# things like opening doors in a level, opening chests/flipping switches etc.
|
||||
|
||||
# This node can keep an array of various interactibles within a level
|
||||
# and provide several helper functions for managing them perhaps.
|
||||
|
||||
export(String) var modifier_parent_callback = ""
|
||||
export var debug_receiver :bool = false
|
||||
|
||||
var call_function: FuncRef
|
||||
|
||||
#var interactable_function_callables = []
|
||||
|
||||
var modifier_collection = []
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
##NOTE:
|
||||
## Call function should be implemented as two parameters, one expecting a modifier
|
||||
## and the other expecting a boolean as to whether its being added
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
if modifier_parent_callback:
|
||||
call_function = funcref(owner, modifier_parent_callback)
|
||||
else:
|
||||
print("Warning: No modifier receiver function defined on ", owner.name)
|
||||
|
||||
# Switching to a new model that starts with Hitbox
|
||||
func register_modifier(modifier: StateModifier):
|
||||
if modifier_collection.has(modifier) == false:
|
||||
print("New Modifier Registered " + modifier.name)
|
||||
modifier_collection.append(modifier)
|
||||
if call_function.is_valid():
|
||||
call_function.call_func(modifier, true)
|
||||
|
||||
func remove_modifier(modifier):
|
||||
print("Modifier Removal " + modifier.name)
|
||||
if modifier_collection.has(modifier):
|
||||
var modifier_index = modifier_collection.rfind(modifier)
|
||||
if modifier_index != -1:
|
||||
modifier_collection.remove(modifier_index)
|
||||
if call_function.is_valid():
|
||||
call_function.call_func(modifier, false)
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://src/components/Modifier_Receiver.gd" type="Script" id=1]
|
||||
|
||||
[node name="Modifier_Receiver" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=34 format=2]
|
||||
[gd_scene load_steps=33 format=2]
|
||||
|
||||
[ext_resource path="res://src/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/enemyC/enemyC_movement_component.gd" type="Script" id=2]
|
||||
|
|
@ -122,9 +122,6 @@ extents = Vector2( 9, 3.5 )
|
|||
[sub_resource type="CapsuleShape2D" id=24]
|
||||
height = 10.0
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=25]
|
||||
extents = Vector2( 10.5, 17.5 )
|
||||
|
||||
[node name="EnemyC" instance=ExtResource( 1 )]
|
||||
script = ExtResource( 6 )
|
||||
actor_type = "Enemy"
|
||||
|
|
@ -133,7 +130,7 @@ actor_type = "Enemy"
|
|||
position = Vector2( 11, -7 )
|
||||
frames = SubResource( 20 )
|
||||
animation = "idle"
|
||||
frame = 2
|
||||
frame = 1
|
||||
__meta__ = {
|
||||
"_aseprite_wizard_config_": {
|
||||
"layer": "",
|
||||
|
|
@ -147,7 +144,10 @@ __meta__ = {
|
|||
}
|
||||
}
|
||||
|
||||
[node name="movement_component" parent="." index="1"]
|
||||
[node name="CollisionShape2D" parent="." index="1"]
|
||||
position = Vector2( -0.5, -2 )
|
||||
|
||||
[node name="movement_component" parent="." index="2"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[node name="IdleTimeout" type="Timer" parent="movement_component" index="0"]
|
||||
|
|
@ -189,14 +189,14 @@ timeout_seconds = 0.5
|
|||
move_speed = -5.0
|
||||
animation_sequence = [ "death" ]
|
||||
|
||||
[node name="Hurtbox_Component" parent="." index="3"]
|
||||
[node name="Hurtbox_Component" parent="." index="4"]
|
||||
hurtbox_entered_function = "enemyHit"
|
||||
|
||||
[node name="CollisionShape2D" parent="Hurtbox_Component" index="0"]
|
||||
position = Vector2( -1, -2 )
|
||||
shape = SubResource( 22 )
|
||||
|
||||
[node name="EdgeDetection" type="RayCast2D" parent="." index="5"]
|
||||
[node name="EdgeDetection" type="RayCast2D" parent="." index="6"]
|
||||
modulate = Color( 0.054902, 1, 0, 1 )
|
||||
show_behind_parent = true
|
||||
position = Vector2( 15, 3 )
|
||||
|
|
@ -204,12 +204,12 @@ enabled = true
|
|||
cast_to = Vector2( 0, 17 )
|
||||
collide_with_areas = true
|
||||
|
||||
[node name="PlayerDetection" type="RayCast2D" parent="." index="6"]
|
||||
[node name="PlayerDetection" type="RayCast2D" parent="." index="7"]
|
||||
enabled = true
|
||||
cast_to = Vector2( 21, 0 )
|
||||
collision_mask = 2
|
||||
|
||||
[node name="Hitbox_Component" parent="." index="7" instance=ExtResource( 4 )]
|
||||
[node name="Hitbox_Component" parent="." index="8" instance=ExtResource( 4 )]
|
||||
damage_amount = 10
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox_Component" index="0"]
|
||||
|
|
@ -218,20 +218,16 @@ position = Vector2( 18, -8.5 )
|
|||
shape = SubResource( 23 )
|
||||
disabled = true
|
||||
|
||||
[node name="GenericSender" parent="." index="8" instance=ExtResource( 5 )]
|
||||
[node name="GenericSender" parent="." index="9" instance=ExtResource( 5 )]
|
||||
receiver_node_name = "GenericReceiver"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="GenericSender" index="0"]
|
||||
position = Vector2( 48, 0 )
|
||||
shape = SubResource( 24 )
|
||||
|
||||
[node name="Health_Component" parent="." index="9" instance=ExtResource( 7 )]
|
||||
[node name="Health_Component" parent="." index="10" instance=ExtResource( 7 )]
|
||||
max_health = 20
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="10"]
|
||||
position = Vector2( -0.5, -1.5 )
|
||||
shape = SubResource( 25 )
|
||||
|
||||
[connection signal="frame_reached" from="movement_state_machine/attack" to="." method="_on_attack_frame_reached"]
|
||||
[connection signal="state_exited" from="movement_state_machine/attack" to="." method="_on_attack_state_exited"]
|
||||
[connection signal="health_depleted" from="Health_Component" to="." method="_on_Health_Component_health_depleted"]
|
||||
|
|
|
|||
|
|
@ -17,11 +17,6 @@ var current_movement_state:String
|
|||
# Since animactor state machine can actually view properties from this type
|
||||
# I'm thinking about moving the velocity tracker in here instead of player.
|
||||
var velocity = Vector2(0,0)
|
||||
var momentum = Vector2(0,0)
|
||||
var acceleration = Vector2(0,0)
|
||||
|
||||
var sim_velocity = Vector2(0,0)
|
||||
|
||||
|
||||
#Can't use floats here, switched to constants.
|
||||
#enum directions {UP = -1, DOWN = 1, LEFT, RIGHT}
|
||||
|
|
@ -74,9 +69,3 @@ func wants_dash() -> bool:
|
|||
|
||||
func wants_roll() -> bool:
|
||||
return false
|
||||
|
||||
func wants_climb() -> bool:
|
||||
return false
|
||||
|
||||
func get_climb_shape_location() -> Vector2:
|
||||
return Vector2(-1,-1)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ onready var gun = $Gun
|
|||
|
||||
func _ready() -> void:
|
||||
PlayerInfo.player_health = $Health_Component.health
|
||||
global_position = LevelInfo.player_start_position.transform.origin
|
||||
movement_component.player_number = player_number
|
||||
|
||||
|
||||
|
|
@ -22,29 +21,9 @@ func hit_Receiver(damage):
|
|||
if $Health_Component.health > 0:
|
||||
movement_state_machine.change_state($movement_state_machine/hurt)
|
||||
PlayerInfo.player_health = $Health_Component.health
|
||||
if PlayerInfo.player_health <= 0:
|
||||
return
|
||||
yield( get_tree().create_timer(2 + $movement_state_machine/hurt.timeout_seconds), "timeout")
|
||||
$Hurtbox_Component.set_hurtbox(true)
|
||||
|
||||
func receive_modifier(incomming_modifier :StateModifier, is_adding_modifier_operation: bool):
|
||||
#var mod :StateModifier
|
||||
if is_adding_modifier_operation:
|
||||
print("Player Received modifier:", incomming_modifier.name)
|
||||
if movement_state_machine.current_state is StateAnimatedActor:
|
||||
movement_state_machine.current_state.physics_modifier = incomming_modifier
|
||||
else:
|
||||
print("Player Removed modifier:", incomming_modifier.name)
|
||||
if movement_state_machine.current_state is StateAnimatedActor:
|
||||
movement_state_machine.current_state.physics_modifier = null
|
||||
|
||||
func touch_the_thing(the_thing: Interactable) -> bool:
|
||||
print("You see! a THING...", the_thing.name)
|
||||
if the_thing is HealthPickup:
|
||||
# Do some healthy stuff.
|
||||
the_thing.trigger_interaction()
|
||||
return false
|
||||
return true
|
||||
|
||||
func _on_attack_do_attack():
|
||||
var is_shooting = false
|
||||
|
|
@ -54,18 +33,4 @@ func _on_attack_do_attack():
|
|||
|
||||
|
||||
func _on_Health_Component_health_depleted():
|
||||
$Hurtbox_Component.set_hurtbox(false)
|
||||
movement_state_machine.change_state($movement_state_machine/die)
|
||||
yield( get_tree().create_timer(10), "timeout")
|
||||
#queue_free()
|
||||
|
||||
func _on_roll_frame_reached(state_name, animation_name, frame_number):
|
||||
print("I'm invincible!!!")
|
||||
$Hurtbox_Component.set_hurtbox(false)
|
||||
|
||||
func _on_roll_state_exited():
|
||||
print("Nevermind. I'm vulnerable.")
|
||||
$Hurtbox_Component.set_hurtbox(true)
|
||||
|
||||
func _on_die_state_entered():
|
||||
pass # Replace with function body.
|
||||
queue_free()
|
||||
|
|
|
|||
|
|
@ -17,31 +17,12 @@ extends MovementComponent
|
|||
|
||||
export var player_number: int = 1
|
||||
|
||||
export (NodePath) var interactable_node
|
||||
|
||||
onready var interactable_receiver_node: Interactable_Receiver = get_node(interactable_node)
|
||||
onready var ladder_detection:RayCast2D = $"../Ladder_Detection"
|
||||
|
||||
var ladder_collision: RayCast2D
|
||||
|
||||
func _ready():
|
||||
ladder_collision = ladder_detection
|
||||
# Guess there isn't a hit from inside in 3.5
|
||||
# Remember to make raycast as tall as needed for the player
|
||||
#ladder_collision.hit_from_inside = true
|
||||
|
||||
func process_physics(delta):
|
||||
PlayerInfo.player_position = owner.global_position
|
||||
|
||||
func process_input(event: InputEvent):
|
||||
var interactables = interactable_receiver_node.interactable_function_callables
|
||||
for interactable in interactables: # Iterate through the interactable collection
|
||||
if interactable is Interactable: # Make sure we didn't push something dumb in there.
|
||||
if (Input.is_action_pressed("ui_up")): # We pressed up?
|
||||
interactable.trigger_interaction()
|
||||
get_movement_direction()
|
||||
|
||||
|
||||
# Return the desired direction of movement for the character
|
||||
# in the range [-1, 1], where positive values indicate a desire
|
||||
# to move to the right and negative values to the left.
|
||||
|
|
@ -78,40 +59,6 @@ func wants_roll() -> bool:
|
|||
else:
|
||||
return false
|
||||
|
||||
func wants_climb() -> bool:
|
||||
if ladder_detection.is_colliding() and Input.is_action_pressed("ui_up"):
|
||||
#print("betcha wanna climb though!")
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
||||
func get_climb_shape_location() -> Vector2:
|
||||
if ladder_detection.is_colliding():
|
||||
var point: Vector2 = ladder_collision.get_collision_point()
|
||||
var shape_id = ladder_collision.get_collider_shape()
|
||||
var object = ladder_collision.get_collider()
|
||||
|
||||
# This works but doesn't get the shapes location.
|
||||
# if object is Area2D:
|
||||
# print("You got an area bro!" , object.global_position)
|
||||
|
||||
|
||||
# This appears to get the shapes location!
|
||||
var area = Physics2DServer.area_get_transform(object)
|
||||
var areashape = Physics2DServer.area_get_shape_transform(object, shape_id)
|
||||
|
||||
|
||||
var y_dir = Input.get_axis("ui_up" , "ui_down")
|
||||
#var target = get_collider() # A CollisionObject2D.
|
||||
#var shape_id = get_collider_shape() # The shape index in the collider.
|
||||
#var owner_id = target.shape_find_owner(shape_id) # The owner ID in the collider.
|
||||
#var shape = target.shape_owner_get_owner(owner_id)
|
||||
|
||||
#UiManager.debug_text = str(round(point.x)) + ' ' + str(round(point.y)) #( "Mod(" + str(sign(_move_speed_modifier)) + ") Dir(" + str(move_direction) + ") Vel(" + str(sign(current_x_velocity)) + ") Mov(" + str(sign(move_component.desired_movement_vector.x)) +
|
||||
|
||||
return Vector2(areashape.origin.x, y_dir)
|
||||
else:
|
||||
return Vector2(-1,-1)
|
||||
|
||||
## Other needed variables
|
||||
# desired_movement_vector: Vector2 - Used to store desired movement depending on the state
|
||||
|
|
|
|||
|
|
@ -6,53 +6,36 @@ export (NodePath) var fall_node
|
|||
export (NodePath) var move_node
|
||||
export (NodePath) var draw_weapon_node
|
||||
|
||||
onready var jump_state: StateAnimatedActor = get_node(jump_node)
|
||||
onready var idle_state: StateAnimatedActor = get_node(idle_node)
|
||||
onready var fall_state: StateAnimatedActor = get_node(fall_node)
|
||||
onready var move_state: StateAnimatedActor = get_node(move_node)
|
||||
#onready var weapon_state_modifier: StateModifier = get_node(draw_weapon_node)
|
||||
onready var jump_state: State = get_node(jump_node)
|
||||
onready var idle_state: State = get_node(idle_node)
|
||||
onready var fall_state: State = get_node(fall_node)
|
||||
onready var move_state: State = get_node(move_node)
|
||||
onready var weapon_state_modifier: StateModifier = get_node(draw_weapon_node)
|
||||
|
||||
|
||||
var can_fire = true
|
||||
signal do_attack()
|
||||
|
||||
var draw_weapon_modifier: StateModifier
|
||||
|
||||
func _ready():
|
||||
state_timeout.connect("timeout", self, "disable_cooldown")
|
||||
draw_weapon_modifier = StateModifier.new()
|
||||
var mod_timer :Timer = draw_weapon_modifier.ready( "draw_weapon", "_shoot" , draw_weapon_modifier.TYPE.ANIMATION_SUFFIX, 2.0)
|
||||
add_child(mod_timer)
|
||||
|
||||
|
||||
func disable_cooldown():
|
||||
if debug_state:
|
||||
print("Attack state cooldown timeout. Can attack again.")
|
||||
state_ready = true
|
||||
|
||||
func enter() -> void:
|
||||
if modifier:
|
||||
if modifier.get_instance_id() == draw_weapon_modifier.get_instance_id():
|
||||
#print ("They the same cannot apply modifier: ", draw_weapon_modifier.get_instance_id())
|
||||
modifier = null
|
||||
.enter()
|
||||
#.enter()
|
||||
##TODO: Turn this to clear only the animation modifiers.
|
||||
# modifier_stack_ref.clear()
|
||||
# mod_animation_sequence.clear()
|
||||
# #mod_animation_sequence = animation_sequence.duplicate(true)
|
||||
# mod_animation_sequence.append_array(animation_sequence)
|
||||
# # Reset animation suffix in case there isn't one
|
||||
# animation_suffix = '_shoot'
|
||||
# animation_index = 0
|
||||
# current_animation_sequence = 0
|
||||
# #var enter_animation = ''
|
||||
# var enter_frame = 0
|
||||
#
|
||||
# if debug_state:
|
||||
# print(parent.name, " entering State: ", self.name)
|
||||
# move_component.current_movement_state = self.name
|
||||
# emit_signal("state_entered")
|
||||
modifier_stack_ref.clear()
|
||||
mod_animation_sequence.clear()
|
||||
#mod_animation_sequence = animation_sequence.duplicate(true)
|
||||
mod_animation_sequence.append_array(animation_sequence)
|
||||
# Reset animation suffix in case there isn't one
|
||||
animation_suffix = ''
|
||||
animation_index = 0
|
||||
current_animation_sequence = 0
|
||||
#var enter_animation = ''
|
||||
var enter_frame = 0
|
||||
|
||||
if debug_state:
|
||||
print(parent.name, " entering State: ", self.name)
|
||||
move_component.current_movement_state = self.name
|
||||
emit_signal("state_entered")
|
||||
|
||||
state_timeout.start()
|
||||
can_fire = true
|
||||
# if modifier_stack_ref.has($"../draw_weapon") == false:
|
||||
# $"../draw_weapon".enter()
|
||||
|
|
@ -62,43 +45,21 @@ func enter() -> void:
|
|||
previous_state_frame_number, " ", previous_state_name)
|
||||
match previous_animation_name:
|
||||
"idle":
|
||||
#animations.play("idle_shoot")
|
||||
if debug_state:
|
||||
print("no need to change idle animation")
|
||||
animations.play("shoot")
|
||||
"run":
|
||||
animations.play("run_shoot")
|
||||
animations.frame = previous_state_frame_number
|
||||
"jump":
|
||||
animations.play("jump_shoot")
|
||||
animations.frame = previous_state_frame_number
|
||||
if debug_state:
|
||||
print("Starting Animation: jump_shoot at frame ", animations.animation , animations.frame)
|
||||
_:
|
||||
print("Warning!: Attack state encountered unhandled prev animation: ", previous_animation_name)
|
||||
|
||||
# An example where the modifier is left to alert on a timeout
|
||||
#mod_timer.connect("timeout", draw_weapon_modifier, "_on_Timer_timeout")
|
||||
# An example where the current node subscribes
|
||||
#mod_timer.connect("timeout", self, "_on_Timer_timeout")
|
||||
|
||||
state_timeout.start()
|
||||
draw_weapon_modifier.state_timeout.start()
|
||||
state_ready = false
|
||||
animation_finished = false
|
||||
|
||||
func _on_Timer_timeout():
|
||||
print("Modifier Timeout from attack! Forcing animation recall")
|
||||
#animations.stop()
|
||||
|
||||
func process_frame(delta: float) -> State:
|
||||
if animation_finished:
|
||||
draw_weapon_modifier.state_timeout.start()
|
||||
modifier = draw_weapon_modifier
|
||||
return idle_state
|
||||
# if animations.frame == 2:
|
||||
# animations.stop()
|
||||
# if state_timeout.time_left == 0 and animations.animation == "shoot":
|
||||
# return idle_state
|
||||
if state_timeout.time_left == 0 and animations.animation == "shoot":
|
||||
return idle_state
|
||||
return null
|
||||
|
||||
|
||||
|
|
@ -109,19 +70,14 @@ func process_physics(delta: float) -> State:
|
|||
can_fire = false
|
||||
|
||||
if move_component.wants_jump() and parent.is_on_floor():
|
||||
draw_weapon_modifier.state_timeout.start()
|
||||
jump_state.modifier = draw_weapon_modifier
|
||||
return jump_state
|
||||
|
||||
move_actor_as_desired(delta)
|
||||
|
||||
# if previous_state_name == "move" and move_component.velocity.x == 0.0:
|
||||
# return idle_state
|
||||
if previous_state_name == "move" and move_component.velocity.x == 0.0:
|
||||
return idle_state
|
||||
|
||||
if move_component.velocity.x != 0.0:
|
||||
draw_weapon_modifier.state_timeout.start()
|
||||
move_state.modifier = draw_weapon_modifier
|
||||
#draw_weapon_modifier.transfer_owner(move_state)
|
||||
if previous_state_name == "idle" and move_component.velocity.x != 0.0:
|
||||
return move_state
|
||||
|
||||
if move_component.get_movement_direction() != 0.0:
|
||||
|
|
@ -131,10 +87,16 @@ func process_physics(delta: float) -> State:
|
|||
# return move_state
|
||||
|
||||
if !parent.is_on_floor():
|
||||
draw_weapon_modifier.state_timeout.start()
|
||||
fall_state.modifier = draw_weapon_modifier
|
||||
return fall_state
|
||||
|
||||
|
||||
return null
|
||||
|
||||
func exit() -> void:
|
||||
# force timer reset
|
||||
weapon_state_modifier.state_timeout.start()
|
||||
push_animation_state_modifier(weapon_state_modifier)
|
||||
#$"../draw_weapon".state_timeout.start()
|
||||
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
extends StateAnimatedActor
|
||||
|
||||
export (NodePath) var idle_node
|
||||
|
||||
onready var idle_state: StateAnimatedActor = get_node(idle_node)
|
||||
#onready var landing_mod: StateModifier = get_node(landing_node)
|
||||
|
||||
var climbing_modifier: StateModifier
|
||||
|
||||
func _ready():
|
||||
climbing_modifier= StateModifier.new()
|
||||
#add_child(modifier)
|
||||
#modifier.init_ref()
|
||||
# climbing_modifier.ready( "landing", "jump" , climbing_modifier.TYPE.EXIT_ANIMATION)
|
||||
# climbing_modifier.starting_frame = 6
|
||||
#print("ready! MOD")
|
||||
|
||||
|
||||
func enter() -> void:
|
||||
.enter()
|
||||
animations.frame = 5
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
|
||||
# First allow horizontal movement.
|
||||
#move_actor_as_desired(delta)
|
||||
# Make wure we still want to climb
|
||||
var ladder_location = move_component.get_climb_shape_location()
|
||||
if ladder_location != Vector2(-1,-1):
|
||||
UiManager.debug_text = str(ladder_location) + '\n' + str(ladder_location - parent.global_position) #+ '\n' + str(parent.global_position.distance_to(ladder_location))
|
||||
# An attempt to snap to the ladder location
|
||||
if parent.global_position.x != round(ladder_location.x):
|
||||
parent.global_translate(Vector2(round((ladder_location.x - parent.global_position.x)),(ladder_location.y * move_speed) * delta))
|
||||
if ladder_location.y != 0:
|
||||
animations.play()
|
||||
else:
|
||||
# Make sure we hopped the step index
|
||||
if animation_index > 0:
|
||||
animations.stop()
|
||||
else:
|
||||
return idle_state
|
||||
#parent.move_local_x()
|
||||
#Flip the character before tha actual move maybe.
|
||||
if move_component.get_movement_direction() != 0.0:
|
||||
parent.transform.x.x = move_component.get_movement_direction()
|
||||
|
||||
# if parent.is_on_floor():
|
||||
# #modifier.reference()
|
||||
# idle_state.modifier = climbing_modifier
|
||||
# return idle_state
|
||||
return null
|
||||
|
|
@ -10,7 +10,13 @@ onready var fall_state: State = get_node(fall_node)
|
|||
onready var idle_state: State = get_node(idle_node)
|
||||
onready var attack_state: State = get_node(attack_node)
|
||||
|
||||
#var speed_decay_rate := 1.0
|
||||
var speed_multiplier := 1.0
|
||||
var speed_decay_rate := 1.0
|
||||
|
||||
func enter():
|
||||
.enter()
|
||||
speed_multiplier = 2.8
|
||||
speed_decay_rate = 2.0
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
|
||||
|
|
@ -19,54 +25,24 @@ func process_physics(delta: float) -> State:
|
|||
|
||||
if move_component.wants_jump():
|
||||
return jump_state
|
||||
|
||||
if speed_multiplier > 1.0:
|
||||
#print(speed_multiplier,", ", delta)
|
||||
speed_multiplier -= delta * speed_decay_rate
|
||||
speed_decay_rate += delta
|
||||
elif speed_multiplier < 1.0:
|
||||
speed_multiplier += delta * speed_decay_rate
|
||||
speed_decay_rate += delta
|
||||
|
||||
# Deadzone
|
||||
if speed_multiplier < 1.1 and speed_multiplier > 0.9:
|
||||
speed_multiplier = 1.0
|
||||
|
||||
# Move the last direction we were facing.
|
||||
move_actor_as_desired(delta, parent.transform.x.x)
|
||||
# # Assuming adjusted_move_speed is set to the mood speed modifier on state entry
|
||||
# # Move speed is the base speed plus the modifier minus the decay adjusted for time
|
||||
# jerk += jerk_factor * delta
|
||||
# adjusted_move_speed += move_modifier_move_acceleration * delta
|
||||
# var new_move_speed = move_speed + (move_acceleration * delta) + adjusted_move_speed + jerk
|
||||
#
|
||||
# # A really crappy normalization to prevent modifying past the base move speed.
|
||||
# if move_speed_modifier > 0 and new_move_speed < move_speed: # positive modifier
|
||||
# #print("nope1")
|
||||
# new_move_speed = move_speed
|
||||
# elif move_speed_modifier < 0 and new_move_speed > move_speed: # negative modifier
|
||||
# #print("nope2")
|
||||
# new_move_speed = move_speed
|
||||
# else:
|
||||
# UiManager.debug_text = str(round(adjusted_move_speed)) + "," + str(round(new_move_speed)) + "," + str(round(jerk))
|
||||
# #print(adjusted_move_speed, ",", new_move_speed, ",", jerk)
|
||||
#
|
||||
# #print(new_move_speed, " ", adjusted_move_speed)
|
||||
#
|
||||
# move_component.velocity.y += gravity * delta
|
||||
# #parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
# #print(speed_multiplier)
|
||||
# move_component.velocity.x = parent.transform.x.x * new_move_speed
|
||||
# move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
||||
|
||||
## Trying a whole new model
|
||||
# var new_move_speed = move_speed * speed_multiplier
|
||||
# if speed_multiplier > 1.0:
|
||||
# print("PPS: ", new_move_speed * delta)
|
||||
# speed_multiplier -= delta * (speed_decay_rate * speed_multiplier)
|
||||
# #speed_decay_rate += delta * speed_decay_rate
|
||||
#
|
||||
# elif speed_multiplier < 1.0:
|
||||
# speed_multiplier += delta * (speed_decay_rate * speed_multiplier)
|
||||
# #speed_decay_rate += delta * speed_decay_rate
|
||||
#
|
||||
# # Deadzone
|
||||
# if speed_multiplier < 1.1 and speed_multiplier > 0.9:
|
||||
# speed_multiplier = 1.0
|
||||
#
|
||||
# move_component.velocity.y += gravity * delta
|
||||
# #parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
# #print(speed_multiplier)
|
||||
# move_component.velocity.x = parent.transform.x.x * new_move_speed
|
||||
# move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
||||
move_component.velocity.y += gravity * delta
|
||||
#parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
#print(speed_multiplier)
|
||||
move_component.velocity.x = parent.transform.x.x * move_speed * speed_multiplier
|
||||
move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
||||
|
||||
|
||||
if move_component.velocity.x == 0.0 or animations.playing == false:
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
extends StateAnimatedActor
|
||||
|
||||
func enter() -> void:
|
||||
# modifier_stack_ref.clear()
|
||||
.enter()
|
||||
move_component.velocity.x = 0
|
||||
|
||||
|
||||
func process_physics(_delta: float) -> State:
|
||||
#Dead Dead dead.
|
||||
#move_actor_as_desired(_delta)
|
||||
return null
|
||||
|
|
@ -3,25 +3,10 @@ extends StateAnimatedActor
|
|||
export (NodePath) var idle_node
|
||||
export (NodePath) var landing_node
|
||||
|
||||
onready var idle_state: StateAnimatedActor = get_node(idle_node)
|
||||
#onready var landing_mod: StateModifier = get_node(landing_node)
|
||||
|
||||
var landing_modifier: StateModifier
|
||||
|
||||
func _ready():
|
||||
landing_modifier= StateModifier.new()
|
||||
#add_child(modifier)
|
||||
#modifier.init_ref()
|
||||
landing_modifier.ready( "landing", "jump" , landing_modifier.TYPE.EXIT_ANIMATION)
|
||||
landing_modifier.starting_frame = 6
|
||||
#print("ready! MOD")
|
||||
|
||||
onready var idle_state: State = get_node(idle_node)
|
||||
onready var landing_mod: StateModifier = get_node(landing_node)
|
||||
|
||||
func enter() -> void:
|
||||
# var landing_mod_index = modifier_stack_ref.rfind(landing_mod)
|
||||
# if landing_mod_index != -1:
|
||||
# #print("You're Supposed to be dead!?: ", landing_mod_index)
|
||||
# modifier_stack_ref.remove(landing_mod_index)
|
||||
.enter()
|
||||
# Jump to fall frame
|
||||
animations.frame = 5
|
||||
|
|
@ -37,14 +22,13 @@ func process_physics(delta: float) -> State:
|
|||
parent.transform.x.x = move_component.get_movement_direction()
|
||||
|
||||
if parent.is_on_floor():
|
||||
#modifier.reference()
|
||||
idle_state.modifier = landing_modifier
|
||||
return idle_state
|
||||
|
||||
return null
|
||||
|
||||
#func exit() -> void:
|
||||
# .exit()
|
||||
## push_animation_state_modifier(landing_mod)
|
||||
## $"../landing".enter()
|
||||
## modifier_stack_ref.push_front($"../landing")
|
||||
# return
|
||||
func exit() -> void:
|
||||
.exit()
|
||||
push_animation_state_modifier(landing_mod)
|
||||
# $"../landing".enter()
|
||||
# modifier_stack_ref.push_front($"../landing")
|
||||
return
|
||||
|
|
|
|||
|
|
@ -4,28 +4,13 @@ export (NodePath) var idle_node
|
|||
|
||||
onready var idle_state: State = get_node(idle_node)
|
||||
|
||||
var flash_color = Color.yellow
|
||||
|
||||
var store_modifier: StateModifier
|
||||
|
||||
func enter() -> void:
|
||||
if modifier:
|
||||
if debug_state:
|
||||
print(name, " skipping modifier and holding for next state.")
|
||||
store_modifier = modifier
|
||||
modifier = null
|
||||
# modifier_stack_ref.clear()
|
||||
.enter()
|
||||
move_component.velocity.x = 0
|
||||
#parent.set_hurtbox(false)
|
||||
#TODO: Error check if timer was actually instanced
|
||||
state_timeout.start()
|
||||
|
||||
func exit() -> void:
|
||||
modifier = store_modifier
|
||||
.exit()
|
||||
animations.modulate = Color.white
|
||||
|
||||
func process_input(_event: InputEvent) -> State:
|
||||
# move_component.wants_jump()
|
||||
move_component.get_movement_direction()
|
||||
|
|
@ -34,11 +19,6 @@ func process_input(_event: InputEvent) -> State:
|
|||
|
||||
|
||||
func process_frame(delta: float) -> State:
|
||||
|
||||
# Apply a little effect when damage taken.
|
||||
#UiManager.debug_text = str(abs(sin((ceil(state_timeout.time_left) - state_timeout.time_left)/.5)))
|
||||
animations.modulate = flash_color.linear_interpolate(Color.white, abs(sin((ceil(state_timeout.time_left) - state_timeout.time_left)/.5)))
|
||||
|
||||
if state_timeout.time_left == 0:
|
||||
return idle_state
|
||||
return null
|
||||
|
|
@ -47,7 +27,7 @@ func process_frame(delta: float) -> State:
|
|||
func process_physics(delta: float) -> State:
|
||||
move_component.velocity.y += gravity * delta
|
||||
#parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
move_component.velocity.x = parent.transform.x.x * move_speed
|
||||
move_component.velocity = parent.transform.x * move_speed
|
||||
# if (parent.direction.x > 0):
|
||||
# parent.velocity.x = 1 * move_speed
|
||||
# else:
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ export (NodePath) var jump_node
|
|||
export (NodePath) var attack_node
|
||||
export (NodePath) var dash_node
|
||||
export (NodePath) var roll_node
|
||||
export (NodePath) var climb_node
|
||||
|
||||
onready var fall_state: State = get_node(fall_node)
|
||||
onready var move_state: State = get_node(move_node)
|
||||
|
|
@ -14,13 +13,11 @@ onready var jump_state: State = get_node(jump_node)
|
|||
onready var attack_state: State = get_node(attack_node)
|
||||
onready var dash_state: State = get_node(dash_node)
|
||||
onready var roll_state: State = get_node(roll_node)
|
||||
onready var climb_state: State = get_node(climb_node)
|
||||
|
||||
func enter() -> void:
|
||||
.enter()
|
||||
# parent.set_hurtbox(true)
|
||||
#move_component.velocity.x = 0
|
||||
#move_component.momentum.x *= -1
|
||||
move_component.velocity.x = 0
|
||||
if debug_state:
|
||||
print(owner.name, " Move Component: ", move_component.desired_movement_vector.x)
|
||||
|
||||
|
|
@ -36,15 +33,13 @@ func process_physics(delta: float) -> State:
|
|||
if move_component.wants_dash() and parent.is_on_floor():
|
||||
return dash_state
|
||||
|
||||
if move_component.wants_climb():
|
||||
return climb_state
|
||||
|
||||
if move_component.wants_shoot():
|
||||
return attack_state
|
||||
|
||||
move_actor_as_desired(delta)
|
||||
|
||||
if move_component.desired_movement_vector.x != 0 and move_component.velocity.x != 0:
|
||||
if move_component.velocity.x != 0.0:
|
||||
return move_state
|
||||
|
||||
if !parent.is_on_floor():
|
||||
|
|
|
|||
|
|
@ -4,22 +4,15 @@ extends StateAnimatedActor
|
|||
export (NodePath) var idle_node
|
||||
export (NodePath) var fall_node
|
||||
export (NodePath) var attack_node
|
||||
export (NodePath) var landing_node
|
||||
|
||||
|
||||
onready var idle_state: State = get_node(idle_node)
|
||||
onready var fall_state: State = get_node(fall_node)
|
||||
onready var attack_state: State = get_node(attack_node)
|
||||
#onready var landing_mod: StateModifier = get_node(landing_node)
|
||||
|
||||
export var jump_force: float = 200.0
|
||||
|
||||
func enter() -> void:
|
||||
# var landing_mod_index = modifier_stack_ref.rfind(landing_mod)
|
||||
# if landing_mod_index != -1:
|
||||
# #print("You're Supposed to be dead!?: ", landing_mod_index)
|
||||
# modifier_stack_ref.remove(landing_mod_index)
|
||||
# if modifier_stack_ref.has(landing_mod):
|
||||
# print("Jump from Landing Mod at: ", modifier_stack_ref.rfind(landing_mod))
|
||||
.enter()
|
||||
# Apply initial jump velocity on state enter
|
||||
move_component.velocity.y = -jump_force
|
||||
|
|
|
|||
|
|
@ -19,15 +19,12 @@ func process_physics(delta: float) -> State:
|
|||
|
||||
move_actor_as_desired(delta)
|
||||
|
||||
# if move_component.velocity.x == 0.0:
|
||||
# return idle_state
|
||||
if move_component.velocity.x == 0.0:
|
||||
return idle_state
|
||||
|
||||
#Flip the character before tha actual move maybe.
|
||||
if move_component.get_movement_direction() != 0.0:
|
||||
parent.transform.x.x = move_component.get_movement_direction()
|
||||
|
||||
if move_component.desired_movement_vector.x == 0:
|
||||
return idle_state
|
||||
|
||||
if !parent.is_on_floor():
|
||||
return fall_state
|
||||
|
|
|
|||
|
|
@ -6,13 +6,9 @@ export (NodePath) var idle_node
|
|||
onready var fall_state: State = get_node(fall_node)
|
||||
onready var idle_state: State = get_node(idle_node)
|
||||
|
||||
var speed_multiplier := 1.0
|
||||
var speed_decay_rate := 1.0
|
||||
|
||||
func enter():
|
||||
#remove_animation_state_modifiers()
|
||||
.enter()
|
||||
|
||||
|
||||
func process_physics(delta: float) -> State:
|
||||
|
||||
# if move_component.wants_shoot():
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
extends Node
|
||||
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
var player_start_position: Position2D
|
||||
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
|
|
@ -9,8 +9,6 @@ var dialog_text = 'foo'
|
|||
var dialog_portrait = preload("res://icon.png")
|
||||
var current_pane = UI_PANES.OFF
|
||||
|
||||
var debug_text :String
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ signal state_entered()
|
|||
signal state_exited()
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
#var modifier_stack_ref: Array # Well this didn't work
|
||||
var modifier_stack_ref: Array # Well this didn't work
|
||||
var state_timeout: Timer
|
||||
var state_ready: bool = true
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
|
|
|||
|
|
@ -16,20 +16,7 @@ extends State
|
|||
## Deprecated
|
||||
# export var animation_name: String
|
||||
|
||||
# Movement Speed in Pixels Per Second
|
||||
export var move_speed: float = 60
|
||||
export var move_acceleration: float = 0
|
||||
export var move_speed_modifier: float = 0
|
||||
export var move_modifier_move_acceleration: float = 0
|
||||
export var jerk_factor: float = 0
|
||||
|
||||
#var adjusted_move_speed: float
|
||||
var jerk: float
|
||||
|
||||
var physics_modifier :StateModifier
|
||||
|
||||
##TODO: Deprecate this useless fool!
|
||||
var speed_multiplier: float = 1.0
|
||||
|
||||
export(Array, String) var animation_sequence
|
||||
|
||||
|
|
@ -37,9 +24,6 @@ signal frame_reached(state_name, animation_name, frame_number)
|
|||
export(Dictionary) var emitter_frame_subscriptions
|
||||
var frame_signal_emitted: bool = false
|
||||
|
||||
var animation_finished: bool = false
|
||||
|
||||
|
||||
# this just wouldn't work well. Maybe I can try a resource
|
||||
# export(Array, NodePath) var transition_state_nodes
|
||||
|
||||
|
|
@ -61,9 +45,6 @@ var parent: KinematicBody2D
|
|||
var previous_animation_name : String
|
||||
var previous_state_frame_number : int
|
||||
var previous_state_name: String
|
||||
var previous_speed_multiplier: float
|
||||
|
||||
var modifier: StateModifier
|
||||
|
||||
#var animation_sequence_timer: Timer
|
||||
|
||||
|
|
@ -78,75 +59,76 @@ func _ready():
|
|||
state_timeout.one_shot = true
|
||||
state_timeout.autostart = false
|
||||
add_child(state_timeout)
|
||||
|
||||
#modifier = StateModifier.new()
|
||||
|
||||
# If called, this will attempt to make the most appropriate animation change
|
||||
# would likely be triggered from an animation sequence finishing or a
|
||||
# modifier being applied/removed outside of enter/exit transitions.
|
||||
func update_animation(enter_frame := 0, index := 0, suffix := ''):
|
||||
## TODO:
|
||||
# Need to find a way to attempt to keep and transfer the Index or frame
|
||||
#
|
||||
# if clear_modifier:
|
||||
# print("Goodbye Modifiers!")
|
||||
# modifier = null
|
||||
# if modifier:
|
||||
# if modifier.state_timeout and modifier.timeout_seconds == 0:
|
||||
# modifier = null
|
||||
|
||||
# By Default, we build an animation sequence off of this state's before checking
|
||||
# for modifiers
|
||||
func enter() -> void:
|
||||
# animations.connect("animation_finished", self, "_on_AnimatedSprite_animation_finished")
|
||||
mod_animation_sequence.clear()
|
||||
#mod_animation_sequence = animation_sequence.duplicate(true)
|
||||
mod_animation_sequence.append_array(animation_sequence)
|
||||
# Reset animation suffix in case there isn't one
|
||||
animation_suffix = suffix
|
||||
animation_index = index
|
||||
current_animation_sequence = animation_index
|
||||
animation_suffix = ''
|
||||
animation_index = 0
|
||||
current_animation_sequence = 0
|
||||
#var enter_animation = ''
|
||||
#var enter_frame = 0
|
||||
var enter_frame = 0
|
||||
|
||||
if debug_state:
|
||||
print(parent.name, " entering State: ", self.name)
|
||||
move_component.current_movement_state = self.name
|
||||
emit_signal("state_entered")
|
||||
#modifier_stack_ref = state_modifiers
|
||||
|
||||
# A new attempt at animation modifiers
|
||||
if modifier_stack_ref.empty() == false:
|
||||
print("nope: ")
|
||||
var i = modifier_stack_ref.size() - 1
|
||||
##NOTE: i apparently reverse range itteration doesn't work
|
||||
#for i in range(modifier_stack_ref.size(), 0): # work in reverse
|
||||
while (i >= 0 and modifier_stack_ref[i].modifier_type != "None"):
|
||||
print("Animation Modifier!: ",modifier_stack_ref[i].modifier_type)
|
||||
match modifier_stack_ref[i].modifier_type:
|
||||
"Exit Animation":
|
||||
mod_animation_sequence.push_front(modifier_stack_ref[i].animation_name)
|
||||
enter_frame = modifier_stack_ref[i].starting_frame
|
||||
|
||||
# Gonna ty and avoid this for now
|
||||
#modifier_stack_ref.pop_at(i) # we're done with this modifier
|
||||
|
||||
"Animation Suffix":
|
||||
if animations.frames.has_animation(mod_animation_sequence[animation_index] + modifier_stack_ref[i].animation_name):
|
||||
animation_suffix = modifier_stack_ref[i].animation_name
|
||||
else:
|
||||
print("Warning!: Animation suffix that doesn't exist ",
|
||||
mod_animation_sequence[animation_index] + modifier_stack_ref[i].animation_name)
|
||||
"Replace Animation":
|
||||
#animations.play(modifier_stack_ref[i].animation_name)
|
||||
#animations.frame = modifier_stack_ref[i].starting_frame
|
||||
mod_animation_sequence.clear()
|
||||
mod_animation_sequence.push_back(modifier_stack_ref[i].animation_name)
|
||||
enter_frame = modifier_stack_ref[i].starting_frame
|
||||
i -= 1
|
||||
|
||||
if modifier != null:
|
||||
# if modifier.modifier_type == modifier.TYPE.EXIT_ANIMATION:
|
||||
# #print("OHHH Modifier Applies! ", modifier.animation_name)
|
||||
# mod_animation_sequence.push_front(modifier.animation_name)
|
||||
# enter_frame = modifier.starting_frame
|
||||
match modifier.modifier_type:
|
||||
modifier.TYPE.EXIT_ANIMATION:
|
||||
mod_animation_sequence.push_front(modifier.animation_name)
|
||||
enter_frame = modifier.starting_frame
|
||||
|
||||
modifier.TYPE.ANIMATION_SUFFIX:
|
||||
if animations.frames.has_animation(mod_animation_sequence[animation_index] + modifier.animation_name):
|
||||
animation_suffix = modifier.animation_name
|
||||
else:
|
||||
print("Warning!: Modifier attempting to apply suffix that doesn't exist ",
|
||||
mod_animation_sequence[animation_index] + modifier.animation_name)
|
||||
|
||||
modifier.TYPE.REPLACE_ANIMATION:
|
||||
#animations.play(modifier_stack_ref[i].animation_name)
|
||||
#animations.frame = modifier_stack_ref[i].starting_frame
|
||||
mod_animation_sequence.clear()
|
||||
mod_animation_sequence.push_back(modifier.animation_name)
|
||||
enter_frame = modifier.starting_frame
|
||||
|
||||
# Some safety checks with supplied update parameters
|
||||
if animation_index != 0:
|
||||
if mod_animation_sequence.size() < animation_index + 1:
|
||||
if debug_state:
|
||||
print("Warning!: attempting to set to non-existant index ")
|
||||
animation_index = 0
|
||||
current_animation_sequence = animation_index
|
||||
|
||||
if animations.frames.has_animation(mod_animation_sequence[animation_index] + animation_suffix) == false:
|
||||
if debug_state:
|
||||
print("Warning!: Animation doesn't exist! ")
|
||||
|
||||
if enter_frame != 0:
|
||||
if animations.frames.get_frame_count(animations.animation) != animations.frames.get_frame_count(mod_animation_sequence[animation_index] + animation_suffix):
|
||||
if debug_state:
|
||||
print("Warning!: attempting to set a mismatched frame ")
|
||||
enter_frame = 0
|
||||
# if modifier_stack_ref.empty() == false: # a modifier is applied
|
||||
# if modifier_stack_ref[-1].animation_name != '': # the first one has an animation
|
||||
# if modifier_stack_ref[-1].animation_suffix: # it's a suffix type
|
||||
# if mod_animation_sequence.size() > 0: # the current animation is multipart (sequence > 0)
|
||||
# animation_index = 0
|
||||
# current_animation_sequence = 0
|
||||
# # Guess I don't need this one anymore
|
||||
# #if animations.frames.get_animation_names().has(animation_sequence[animation_index] + modifier_stack_ref[-1].animation_name):
|
||||
# if animations.frames.has_animation(mod_animation_sequence[animation_index] + modifier_stack_ref[-1].animation_name):
|
||||
# animation_suffix = modifier_stack_ref[-1].animation_name
|
||||
# elif modifier_stack_ref[-1].pre_append_animation == true: # it's a pre-append type
|
||||
# #animation_sequence.size()
|
||||
# print ("DEBUG: A prepend animation")
|
||||
# #mod_animation_sequence = animation_sequence
|
||||
# mod_animation_sequence.push_front(modifier_stack_ref[-1].animation_name)
|
||||
# else:
|
||||
# animations.play(modifier_stack_ref[-1].animation_name)
|
||||
# animations.frame = modifier_stack_ref[-1].starting_frame
|
||||
# return
|
||||
|
||||
if mod_animation_sequence.size() > 0:
|
||||
if debug_state:
|
||||
|
|
@ -158,75 +140,17 @@ func update_animation(enter_frame := 0, index := 0, suffix := ''):
|
|||
print("Error! Resolved to empty animation sequence!?")
|
||||
return
|
||||
|
||||
|
||||
func enter() -> void:
|
||||
if debug_state:
|
||||
print(parent.name, " entering State: ", self.name)
|
||||
move_component.current_movement_state = self.name
|
||||
emit_signal("state_entered")
|
||||
#modifier_stack_ref = state_modifiers
|
||||
update_animation()
|
||||
|
||||
# Reset movespeed counters
|
||||
#move_component.momentum.x = move_speed_modifier
|
||||
jerk = 0
|
||||
|
||||
return
|
||||
|
||||
func exit() -> void:
|
||||
emit_signal("state_exited")
|
||||
# animations.disconnect("animation_finished", self, "_on_AnimatedSprite_animation_finished")
|
||||
#modifier = null
|
||||
return
|
||||
|
||||
func transfer_modifiers(exiting_state_modifier : StateModifier):
|
||||
if modifier == null: # We have no existing modifier applied.
|
||||
match exiting_state_modifier.modifier_type:
|
||||
exiting_state_modifier.TYPE.ANIMATION_SUFFIX:
|
||||
if debug_state:
|
||||
print("Transferring Animation Suffix")
|
||||
modifier = exiting_state_modifier
|
||||
exiting_state_modifier.TYPE.EXIT_ANIMATION:
|
||||
if debug_state:
|
||||
print("Exit Animation: well this was useless.")
|
||||
else:
|
||||
print("Insert modifier merge function here...")
|
||||
|
||||
func process_input(_event: InputEvent) -> State:
|
||||
return null
|
||||
|
||||
func process_animations():
|
||||
|
||||
if modifier != null:
|
||||
if modifier.state_timeout and modifier.state_timeout.time_left == 0:
|
||||
print("Expired Modifier, updating animation.")
|
||||
#modifier = null
|
||||
match modifier.modifier_type:
|
||||
|
||||
modifier.TYPE.ANIMATION_SUFFIX:
|
||||
# Attempt to seemlessly transition animations.
|
||||
modifier = null
|
||||
update_animation(animations.frame,animation_index)
|
||||
|
||||
modifier.TYPE.REPLACE_ANIMATION:
|
||||
if debug_state:
|
||||
print("I don't have anything for replacements yet.")
|
||||
modifier = null
|
||||
update_animation()
|
||||
_:
|
||||
modifier = null
|
||||
return
|
||||
|
||||
|
||||
# We have no more sequence animations and the current one doesn't loop
|
||||
# we do this to prevent the default idle animation from playing.
|
||||
##TODO: between this and the signal based iterator I get some really strange behavior
|
||||
if animation_index >= mod_animation_sequence.size() and animations.frames.get_animation_loop(
|
||||
animations.animation) == false:
|
||||
#print(animations.animation, " Animation Stopped")
|
||||
animations.stop()
|
||||
#animation_finished = true
|
||||
elif mod_animation_sequence.size() > animation_index and current_animation_sequence != animation_index:
|
||||
func process_frame(_delta: float) -> State:
|
||||
#if animation_sequence.size() > 0 and current_animation_sequence != animation_index:
|
||||
if mod_animation_sequence.size() > animation_index and current_animation_sequence != animation_index:
|
||||
#TODO: why was I doing this
|
||||
# if animation_index >= mod_animation_sequence.size():
|
||||
# animation_index = 0
|
||||
|
|
@ -236,8 +160,11 @@ func process_animations():
|
|||
print("An animation sequence: ", mod_animation_sequence[animation_index - 1], " -> ",
|
||||
animations.animation , " (", animation_index, ")")
|
||||
current_animation_sequence = animation_index
|
||||
|
||||
##TODO: Could probably add some more checks here.
|
||||
# We have no more sequence animations and the current one doesn't loop
|
||||
# we do this to prevent the default idle animation from playing.
|
||||
if animation_index >= mod_animation_sequence.size() and animations.frames.get_animation_loop(
|
||||
animations.animation) == false:
|
||||
animations.stop()
|
||||
|
||||
# Singal based frame call.
|
||||
if emitter_frame_subscriptions.has(animations.frame):
|
||||
|
|
@ -249,7 +176,6 @@ func process_animations():
|
|||
else:
|
||||
frame_signal_emitted = false
|
||||
|
||||
func process_frame(_delta: float) -> State:
|
||||
return null
|
||||
|
||||
func process_physics(_delta: float) -> State:
|
||||
|
|
@ -260,194 +186,53 @@ func process_physics(_delta: float) -> State:
|
|||
# if animations.frames.get_animation_loop(animations.animation) == false:
|
||||
# animation_index += 1
|
||||
|
||||
func move_actor_as_desired(delta: float, x_move_direction_override: float = 0):
|
||||
|
||||
var _move_speed = move_speed
|
||||
var _move_speed_modifier = move_speed_modifier
|
||||
var _move_modifier_move_acceleration = move_modifier_move_acceleration
|
||||
var _move_acceleration = move_acceleration
|
||||
var _jerk_factor = jerk_factor
|
||||
var _gravity = gravity
|
||||
|
||||
if physics_modifier:
|
||||
#physics_modifier.modifier_properties.jerk_factor
|
||||
#print(physics_modifier.name)
|
||||
#UiManager.debug_text = physics_modifier.name + str(round(adjusted_move_speed))
|
||||
var mod_props :ModifierProperties = physics_modifier.get_modifier_properties()
|
||||
if mod_props.move_speed != 0 and mod_props.directional_modifier == false:
|
||||
_move_speed = mod_props.move_speed
|
||||
_move_speed_modifier += mod_props.move_speed_modifier
|
||||
_move_acceleration += mod_props.move_acceleration
|
||||
_move_modifier_move_acceleration += mod_props.move_modifier_move_acceleration
|
||||
_jerk_factor += mod_props.jerk_factor
|
||||
|
||||
var help_me_not_be_dumb = ''
|
||||
|
||||
# Allow us to bump out of halt.
|
||||
if _move_speed == 0 and move_component.desired_movement_vector.x != 0:
|
||||
_move_speed = abs(move_component.desired_movement_vector.x)
|
||||
|
||||
# Determine or physics movement direction
|
||||
var current_x_velocity = move_component.velocity.x #move_component.velocity.x
|
||||
var move_direction = 0.0
|
||||
# Determine movement direction if we have momentum
|
||||
if move_component.momentum.x != 0:
|
||||
if x_move_direction_override == 0:
|
||||
move_direction = sign(current_x_velocity)
|
||||
# if move_component.desired_movement_vector.x != 0:
|
||||
# # set the move direction to the desired direction
|
||||
# move_direction = move_component.desired_movement_vector.x
|
||||
# else:
|
||||
# # Set move direction to the transform direction
|
||||
# move_direction = parent.transform.x.x
|
||||
else:
|
||||
move_direction = x_move_direction_override
|
||||
else: # No current momentum in place
|
||||
if x_move_direction_override == 0:
|
||||
move_direction = move_component.desired_movement_vector.x
|
||||
else:
|
||||
move_direction = x_move_direction_override
|
||||
|
||||
## TODO: I hate that I have to do this check again.
|
||||
if physics_modifier:
|
||||
var mod_props :ModifierProperties = physics_modifier.get_modifier_properties()
|
||||
if mod_props.move_speed != 0 and mod_props.directional_modifier == true:
|
||||
# Since move_direction is always positive
|
||||
if sign(move_direction) == sign(mod_props.move_speed):
|
||||
_move_speed += mod_props.move_speed
|
||||
else:
|
||||
_move_speed -= mod_props.move_speed
|
||||
if sign(move_direction) == 0:
|
||||
move_direction = sign(mod_props.move_speed) * -1
|
||||
#print("doing this? ")
|
||||
|
||||
|
||||
|
||||
# Determine the maximum move speed
|
||||
var MAX_SPEED :float = 0
|
||||
var MIN_SPEED :float = 0
|
||||
if sign(_move_speed_modifier) == -1: # decreased speed modifier
|
||||
help_me_not_be_dumb += '-SpeedMod'
|
||||
# Move speed cannot go below zero with modifier applied
|
||||
MIN_SPEED = _move_speed + _move_speed_modifier
|
||||
# Poor man's clamp
|
||||
if MIN_SPEED < 0:
|
||||
MIN_SPEED = 0
|
||||
MAX_SPEED = _move_speed
|
||||
elif sign(_move_speed_modifier) == +1: # increased speed modifier
|
||||
help_me_not_be_dumb += '+SpeedMod'
|
||||
MIN_SPEED = _move_speed
|
||||
MAX_SPEED = _move_speed + _move_speed_modifier
|
||||
else: # physics won't apply here
|
||||
help_me_not_be_dumb += '_Speed' # Neutral Speed
|
||||
MIN_SPEED = _move_speed
|
||||
MAX_SPEED = _move_speed
|
||||
|
||||
# get the latest aggregate acceleration
|
||||
# If we have any acceleration applying
|
||||
if (_move_modifier_move_acceleration + _move_acceleration) != 0:
|
||||
# The acceleration is differant
|
||||
# Perhaps it would be better to trigger this on a difference in modifier but they usually go together.
|
||||
if abs(move_component.acceleration.x) != abs(_move_modifier_move_acceleration + _move_acceleration):
|
||||
if move_direction:
|
||||
print("Acceleration changed.", abs(move_component.acceleration.x), "-", (_move_modifier_move_acceleration + _move_acceleration))
|
||||
move_component.acceleration.x = _move_modifier_move_acceleration + _move_acceleration
|
||||
|
||||
# If we're no longer tryingg to move int the direction of our movement and momentum.
|
||||
if sign(current_x_velocity) != sign(move_component.desired_movement_vector.x) and move_component.momentum.x != 0:
|
||||
if sign(_move_speed_modifier) == -1 : # decreased speed modifier
|
||||
|
||||
# Maybe we can compare the direction of the acceleration
|
||||
# The direction of the acceleration should usually be positive at this point.
|
||||
# when the modifier is negative.
|
||||
if sign(move_direction) == sign(current_x_velocity):
|
||||
if sign(move_component.acceleration.x) == sign(move_component.momentum.x):
|
||||
print("Whoh Woah")
|
||||
# Flip the direction of the acceleration
|
||||
move_component.acceleration.x *= -1
|
||||
if (sign(move_component.desired_movement_vector.x) == -1 and
|
||||
sign(current_x_velocity) == 1) or (sign(move_component.desired_movement_vector.x) == -1 and
|
||||
sign(current_x_velocity) == -1):
|
||||
print("be more opposite")
|
||||
# if sign(_move_speed_modifier) == 1: # increased speed modifier
|
||||
# print("faster faster.")
|
||||
elif sign(move_component.desired_movement_vector.x) == sign(current_x_velocity) and move_component.momentum.x != 0:
|
||||
if sign(move_component.acceleration.x) != sign(move_component.momentum.x) and x_move_direction_override == 0:
|
||||
print("Step it up!")
|
||||
# Flip the direction of the acceleration
|
||||
move_component.acceleration.x *= -1
|
||||
|
||||
# Apply momentum and acceleration if a modifer exists
|
||||
if move_component.momentum.x <= 0 and _move_speed_modifier !=0:
|
||||
#if we're trying to move but we have no momentum applied currently
|
||||
#if move_component.desired_movement_vector.x != 0:
|
||||
if move_direction:
|
||||
move_component.acceleration.x = _move_modifier_move_acceleration + _move_acceleration
|
||||
##TODO: I don't know where I should actually set the momentum. :
|
||||
if sign(_move_speed_modifier) == -1: # decreased speed modifier
|
||||
move_component.momentum.x = 0
|
||||
elif sign(_move_speed_modifier) == +1: # increased speed modifier
|
||||
##TODO: in most cases this should only be applied once. need to find a way to warn against this.
|
||||
move_component.momentum.x = abs(move_speed_modifier)
|
||||
print("momentum applied!")
|
||||
|
||||
# Reverse the accelerations if we carry over momentum but the modifier no longer applies.
|
||||
if move_component.momentum.x > 0 and _move_speed_modifier == 0:
|
||||
if sign(move_component.acceleration.x) == sign(move_component.momentum.x):
|
||||
print("Whoh Woah your done.")
|
||||
# Flip the direction of the acceleration
|
||||
move_component.acceleration.x *= -1
|
||||
|
||||
|
||||
# We're going to adjust our move speed only to the modifier
|
||||
move_component.momentum.x += move_component.acceleration.x * delta
|
||||
jerk += _jerk_factor * delta
|
||||
|
||||
|
||||
var new_move_speed :float = 0
|
||||
if sign(_move_speed_modifier) == -1: # decreased speed modifier
|
||||
# MIN_SPEED = _move_speed + _move_speed_modifier
|
||||
# MAX_SPEED = _move_speed
|
||||
move_component.momentum.x = clamp(move_component.momentum.x, 0, abs(_move_speed_modifier))
|
||||
# new_move_speed = (_move_speed + _move_speed_modifier ) + (sign(_move_speed_modifier) * -1 * move_component.momentum.x) # + jerk
|
||||
new_move_speed = MIN_SPEED + (sign(_move_speed_modifier) * -1 * move_component.momentum.x) # + jerk
|
||||
elif sign(_move_speed_modifier) == +1: # increased speed modifier
|
||||
# MIN_SPEED = _move_speed
|
||||
# MAX_SPEED = _move_speed + _move_speed_modifier
|
||||
move_component.momentum.x = clamp(move_component.momentum.x, 0, _move_speed_modifier )
|
||||
new_move_speed = _move_speed + move_component.momentum.x # + jerk
|
||||
else: # physics won't apply here
|
||||
# move_component.acceleration.x = 0
|
||||
# move_component.momentum.x = 0
|
||||
# new_move_speed = _move_speed
|
||||
move_component.momentum.x = clamp(move_component.momentum.x, 0, MIN_SPEED )
|
||||
new_move_speed = _move_speed + move_component.momentum.x # + jerk
|
||||
|
||||
#new_move_speed = clamp(new_move_speed, MIN_SPEED, MAX_SPEED)
|
||||
|
||||
var sim_move_speed = (MIN_SPEED + (sign(_move_speed_modifier) * -1 * move_component.momentum.x))
|
||||
|
||||
# if move_component.momentum.x != 0:
|
||||
if true:
|
||||
UiManager.debug_text = ( "Mod(" + str(sign(_move_speed_modifier)) + ") Dir(" + str(move_direction) + ") Vel(" + str(sign(current_x_velocity)) + ") Mov(" + str(sign(move_component.desired_movement_vector.x)) +
|
||||
")\nNS:" + str(round(sim_move_speed)) + #" Z:" + str(sign(_move_speed_modifier) * -1 * move_component.momentum.x) +
|
||||
"\nS:" + str(round(_move_speed + _move_speed_modifier)) + ",M" + str(round(move_component.momentum.x)) +
|
||||
",A" + str(round(move_component.acceleration.x)) +
|
||||
"\nVel:" + str(round(move_component.velocity.x)) + "Min:" + str(round(MIN_SPEED)) + ",Max:" + str(round(MAX_SPEED))
|
||||
) # str(round(jerk))
|
||||
|
||||
move_component.sim_velocity.x = move_direction * sim_move_speed
|
||||
#print(adjusted_move_speed, ",", new_move_speed, ",", jerk)
|
||||
|
||||
#print(new_move_speed, " ", adjusted_move_speed)
|
||||
|
||||
move_component.velocity.y += _gravity * delta
|
||||
func move_actor_as_desired(delta: float):
|
||||
move_component.velocity.y += gravity * delta
|
||||
#parent.velocity = parent.move_and_slide(parent.velocity, Vector2(0, -1))
|
||||
#print(speed_multiplier)
|
||||
# move_component.velocity.x = move_component.desired_movement_vector.x * _move_speed
|
||||
move_component.velocity.x = move_direction * new_move_speed
|
||||
#move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2.UP)
|
||||
var snap = Vector2.DOWN * 8
|
||||
if move_component.velocity.y < -8:
|
||||
snap = Vector2.ZERO
|
||||
move_component.velocity = parent.move_and_slide_with_snap(move_component.velocity, snap , Vector2.UP, true)
|
||||
move_component.velocity.x = move_component.desired_movement_vector.x * move_speed
|
||||
move_component.velocity = parent.move_and_slide(move_component.velocity, Vector2(0, -1))
|
||||
|
||||
func push_animation_state_modifier(modifier: StateModifier):
|
||||
## This function attempt to optimally place multiple modifiers in an array
|
||||
# in such a way where the first elements are modifiers without animation changes
|
||||
# the last elements are animation changes or animation suffixes.
|
||||
# there is some potential for performance issues at scale with this kinds of operations.
|
||||
|
||||
# This function will grow in complexity as needed but the idea is that here is
|
||||
# where different modifier logic can be tested and developed.
|
||||
|
||||
# First assure this modifer isn't already there. If it is, maybe I should reset it?
|
||||
if modifier_stack_ref.has(modifier) == false:
|
||||
modifier.enter() # call enter function of the modifier
|
||||
if modifier_stack_ref.size() > 0: # only bother with this if multiple modifers applied
|
||||
# Get the last modifier in the stack
|
||||
var last_modifer: StateModifier = modifier_stack_ref[-1]
|
||||
# If the modifier at the back and the new one are the same type, we have a problem.
|
||||
if last_modifer.modifier_type == modifier.modifier_type and last_modifer.modifier_type != 'None':
|
||||
print("WARNING: Multiple same type modifiers applying.")
|
||||
# Replace the modifier
|
||||
modifier_stack_ref.pop_back()
|
||||
modifier_stack_ref.push_back(modifier)
|
||||
else:
|
||||
match last_modifer.modifier_type:
|
||||
"None":
|
||||
# no special processing, push it to the front of a list
|
||||
modifier_stack_ref.push_front(modifier)
|
||||
"Exit Animation":
|
||||
if modifier.modifier_type == "Animation Suffix":
|
||||
# We place this at the back so we can still modify it maybe?
|
||||
modifier_stack_ref.push_back(modifier)
|
||||
"Animation Suffix":
|
||||
if modifier.modifier_type == "Exit Animation":
|
||||
# We have to place this one right before maybe?
|
||||
# Whoops! Forgot to actually do this
|
||||
#modifier_stack_ref.push_back(modifier)
|
||||
modifier_stack_ref.insert(modifier_stack_ref.size() - 1, modifier)
|
||||
# if last_modifer.animation_name != '': # and if an animation applies
|
||||
# if last_modifer.pre_append_animation == modifier.pre_append_animation: # They're the same type
|
||||
# if modifier.pre_append_animation == true and modifier_stack_ref[-1].animation_suffix == true:
|
||||
# modifier.animation_suffix
|
||||
# modifier_stack_ref.push_back(modifier)
|
||||
else:
|
||||
modifier_stack_ref.push_front(modifier)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export (NodePath) var starting_state
|
|||
export var debug_state_machine: bool = false
|
||||
|
||||
var current_state: State
|
||||
#var state_modifiers: Array
|
||||
var state_modifiers: Array
|
||||
|
||||
# Initialize the state machine by giving each child state a reference to the
|
||||
# parent object it belongs to and enter the default starting_state.
|
||||
|
|
@ -13,7 +13,7 @@ func init() -> void:
|
|||
if child is State:
|
||||
if debug_state_machine:
|
||||
print("Initializing State Node: ", child.name)
|
||||
# child.modifier_stack_ref = state_modifiers
|
||||
child.modifier_stack_ref = state_modifiers
|
||||
if debug_state_machine:
|
||||
child.debug_state = true
|
||||
|
||||
|
|
@ -27,10 +27,10 @@ func change_state(new_state: State) -> void:
|
|||
|
||||
current_state = new_state
|
||||
current_state.enter()
|
||||
# if(state_modifiers.size() > 0 and debug_state_machine):
|
||||
# print("Active Modifiers:")
|
||||
# for mods in state_modifiers:
|
||||
# print(mods.name)
|
||||
if(state_modifiers.size() > 0 and debug_state_machine):
|
||||
print("Active Modifiers:")
|
||||
for mods in state_modifiers:
|
||||
print(mods.name)
|
||||
|
||||
# Pass through functions for the Player to call,
|
||||
# handling state changes as needed.
|
||||
|
|
|
|||
|
|
@ -1,37 +1,25 @@
|
|||
class_name StateMachineAnimatedActor extends StateMachine
|
||||
|
||||
#var physics_modifier : StateModifier
|
||||
|
||||
func change_state(new_state: State) -> void:
|
||||
if new_state.state_ready == false:
|
||||
# Don't transition to unready state
|
||||
return
|
||||
if current_state:
|
||||
current_state.exit()
|
||||
# Set parameters for information
|
||||
if new_state is StateAnimatedActor and current_state is StateAnimatedActor:
|
||||
set_previous_animation( current_state, new_state)
|
||||
if current_state.modifier: # Current state has a modifier
|
||||
new_state.transfer_modifiers(current_state.modifier)
|
||||
current_state.modifier = null
|
||||
if current_state.physics_modifier: # Current state has a physics modifier
|
||||
new_state.physics_modifier = current_state.physics_modifier
|
||||
current_state.physics_modifier = null
|
||||
|
||||
# Set parameters for information
|
||||
if new_state is StateAnimatedActor and current_state is StateAnimatedActor:
|
||||
set_previous_animation( current_state, new_state)
|
||||
|
||||
current_state = new_state
|
||||
current_state.enter()
|
||||
# if(state_modifiers.size() > 0 and debug_state_machine):
|
||||
# print("Active Modifiers:")
|
||||
# for mods in state_modifiers:
|
||||
# print(mods.name)
|
||||
if(state_modifiers.size() > 0 and debug_state_machine):
|
||||
print("Active Modifiers:")
|
||||
for mods in state_modifiers:
|
||||
print(mods.name)
|
||||
|
||||
func set_previous_animation( old_state: StateAnimatedActor, new_state: StateAnimatedActor ) -> void:
|
||||
# added this to help prevent nul index crashes. (Usually because of signal based state changes.)
|
||||
if old_state.mod_animation_sequence:
|
||||
new_state.previous_animation_name = old_state.mod_animation_sequence[old_state.current_animation_sequence]
|
||||
new_state.previous_animation_name = old_state.mod_animation_sequence[old_state.current_animation_sequence]
|
||||
new_state.previous_state_frame_number = old_state.animations.frame
|
||||
new_state.previous_state_name = old_state.name
|
||||
new_state.previous_speed_multiplier = old_state.speed_multiplier
|
||||
|
||||
#animation_name :String, frame_number : int, animation_sequence :Array
|
||||
return
|
||||
|
||||
|
|
@ -46,7 +34,7 @@ func init_animated_actor(parent: KinematicBody2D, animations: AnimatedSprite, mo
|
|||
child.parent = parent
|
||||
child.animations = animations
|
||||
child.move_component = move_component
|
||||
# child.modifier_stack_ref = state_modifiers
|
||||
child.modifier_stack_ref = state_modifiers
|
||||
if debug_state_machine:
|
||||
child.debug_state = true
|
||||
|
||||
|
|
@ -59,67 +47,95 @@ func process_frame(delta: float) -> void:
|
|||
# If the modifier is no longer valid, pop it from the stack.
|
||||
# We could iterate through a whole list of states but I'm not sure i want
|
||||
# states to be that complex.
|
||||
# var current_anim_state :StateAnimatedActor = current_state
|
||||
# if state_modifiers.empty() == false:
|
||||
# for i in range(state_modifiers.size()):
|
||||
# # if this modifer is a timer based one
|
||||
# if state_modifiers[i].state_timeout.time_left == 0 and state_modifiers[i].timeout_seconds !=0:
|
||||
# # Need to do extra stuff if it's an animation based one
|
||||
# if state_modifiers[i].modifier_type == "Animation Suffix":
|
||||
# if debug_state_machine:
|
||||
# print("State Modifier Timeout: ", state_modifiers[i].name, " -> ", state_modifiers[i].animation_name)
|
||||
# # Reset animation suffix
|
||||
# current_anim_state.animation_suffix = ''
|
||||
# # Get the current frame of animation
|
||||
# var current_frame = current_anim_state.animations.frame
|
||||
#
|
||||
# # Set the animation index to the current one
|
||||
# current_anim_state.animation_index = current_anim_state.current_animation_sequence
|
||||
# #current_anim_state.current_animation_sequence
|
||||
# #current_anim_state.animations.play()
|
||||
#
|
||||
# current_anim_state.animations.play(
|
||||
# current_anim_state.mod_animation_sequence[current_anim_state.animation_index])
|
||||
# # Try to set the current frame to the same as before.
|
||||
# current_anim_state.animations.frames.frames.size() >= current_frame
|
||||
# current_anim_state.animations.frame = current_frame
|
||||
#
|
||||
# if debug_state_machine:
|
||||
# print("Pop State Modifier: ", state_modifiers[i].name)
|
||||
# state_modifiers.pop_at(i)
|
||||
if current_state is StateAnimatedActor:
|
||||
current_state.process_animations()
|
||||
var current_anim_state :StateAnimatedActor = current_state
|
||||
if state_modifiers.empty() == false:
|
||||
for i in range(state_modifiers.size()):
|
||||
# if this modifer is a timer based one
|
||||
if state_modifiers[i].state_timeout.time_left == 0 and state_modifiers[i].timeout_seconds !=0:
|
||||
# Need to do extra stuff if it's an animation based one
|
||||
if state_modifiers[i].modifier_type == "Animation Suffix":
|
||||
if debug_state_machine:
|
||||
print("State Modifier Timeout: ", state_modifiers[i].name, " -> ", state_modifiers[i].animation_name)
|
||||
# Reset animation suffix
|
||||
current_anim_state.animation_suffix = ''
|
||||
# Get the current frame of animation
|
||||
var current_frame = current_anim_state.animations.frame
|
||||
|
||||
# Set the animation index to the current one
|
||||
current_anim_state.animation_index = current_anim_state.current_animation_sequence
|
||||
#current_anim_state.current_animation_sequence
|
||||
#current_anim_state.animations.play()
|
||||
|
||||
current_anim_state.animations.play(
|
||||
current_anim_state.mod_animation_sequence[current_anim_state.animation_index])
|
||||
# Try to set the current frame to the same as before.
|
||||
current_anim_state.animations.frames.frames.size() >= current_frame
|
||||
current_anim_state.animations.frame = current_frame
|
||||
|
||||
##TODO:
|
||||
# no longer needed this way maybe. way to overengineer man.
|
||||
# if current_anim_state.animation_sequence.size() >= current_anim_state.mod_animation_sequence.size():
|
||||
# print("Change sequence!: ", current_anim_state.mod_animation_sequence)
|
||||
# print("Origin sequence!: ", current_state.mod_animation_sequence)
|
||||
# current_anim_state.animations.play(
|
||||
# current_anim_state.mod_animation_sequence[current_anim_state.animation_index])
|
||||
# # Try to set the current frame to the same as before.
|
||||
# current_anim_state.animations.frames.frames.size() >= current_frame
|
||||
# current_anim_state.animations.frame = current_frame
|
||||
# else:
|
||||
# current_anim_state.animations.play(
|
||||
# current_anim_state.animation_sequence[0])
|
||||
|
||||
|
||||
if debug_state_machine:
|
||||
print("Pop State Modifier: ", state_modifiers[i].name)
|
||||
state_modifiers.pop_at(i)
|
||||
|
||||
# if state_modifiers[-1].state_timeout.time_left == 0 and state_modifiers[-1].pre_append_animation == false:
|
||||
# if debug_state_machine:
|
||||
# print("Pop State Modifier: ", state_modifiers[-1].name)
|
||||
# state_modifiers.pop_back()
|
||||
# # Reset animation suffix
|
||||
# current_state.animation_suffix = ''
|
||||
# var current_frame = current_state.animations.frame
|
||||
# #current_state.animations.play(current_state.animation_sequence[current_state.animation_index])
|
||||
# #TODO: Bodge to fix crash
|
||||
# current_state.animation_index = 0
|
||||
# current_state.current_animation_sequence = 0
|
||||
# current_state.animations.play(current_state.animation_sequence[0])
|
||||
# current_state.animations.frame = current_frame;
|
||||
var new_state = current_state.process_frame(delta)
|
||||
if new_state:
|
||||
change_state(new_state)
|
||||
|
||||
|
||||
func _on_AnimatedSprite_animation_finished():
|
||||
# if debug_state_machine:
|
||||
# print("Stop!!!!!")
|
||||
|
||||
##TODO:
|
||||
# It's hard to pop an exit animation off when it's stacked with another kind of animation.
|
||||
# for i in state_modifiers.size():
|
||||
# if state_modifiers[i].modifier_type == "Exit Animation":
|
||||
# #print("Time to pop state modifer: ", state_modifiers[i].animation_name, current_state.animation_suffix, " <-> ", current_state.animations.animation + current_state.animation_suffix)
|
||||
# if (state_modifiers[i].animation_name + current_state.animation_suffix) == current_state.animations.animation:
|
||||
# print("Time to pop state modifer: ", state_modifiers[i].animation_name, current_state.animation_suffix, " <-> ", current_state.animations.animation )
|
||||
# print(current_state.mod_animation_sequence)
|
||||
# state_modifiers.pop_at(i)
|
||||
# current_state.animation_index += 1
|
||||
# break
|
||||
for i in state_modifiers.size():
|
||||
if state_modifiers[i].modifier_type == "Exit Animation":
|
||||
#print("Time to pop state modifer: ", state_modifiers[i].animation_name, current_state.animation_suffix, " <-> ", current_state.animations.animation + current_state.animation_suffix)
|
||||
if (state_modifiers[i].animation_name + current_state.animation_suffix) == current_state.animations.animation:
|
||||
print("Time to pop state modifer: ", state_modifiers[i].animation_name, current_state.animation_suffix, " <-> ", current_state.animations.animation )
|
||||
print(current_state.mod_animation_sequence)
|
||||
state_modifiers.pop_at(i)
|
||||
current_state.animation_index += 1
|
||||
break
|
||||
|
||||
# if current_state is StateAnimatedActor:
|
||||
# current_state.animation_finished = true
|
||||
|
||||
# if state_modifiers.empty() == false:
|
||||
# if state_modifiers[-1].pre_append_animation == true:
|
||||
# if debug_state_machine:
|
||||
# print("Pop State Modifier: ", state_modifiers[-1].name)
|
||||
# state_modifiers.pop_back()
|
||||
##TODO:
|
||||
# consider just stopping the animation and index increment here.
|
||||
if current_state.animations.frames.get_animation_loop(
|
||||
current_state.animations.animation) == false:
|
||||
#print("Stop!!!!!", current_state.animation_sequence.size(), " - ", current_state.animation_index)
|
||||
if current_state.animation_sequence.size() > 0:
|
||||
#print("<-- next anim.")
|
||||
print("<-- next anim.")
|
||||
current_state.animation_index += 1
|
||||
if current_state.animation_index >= current_state.animation_sequence.size():
|
||||
#print("Stop!!!!!")
|
||||
current_state.animation_finished = true
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
class_name StateModifier
|
||||
extends Reference
|
||||
extends Node
|
||||
## State modification
|
||||
##
|
||||
## A state modifier doesn't have any direct control of a game object.
|
||||
|
|
@ -10,41 +10,26 @@ extends Reference
|
|||
##
|
||||
## @WIP
|
||||
|
||||
enum TYPE {NONE,EXIT_ANIMATION, ANIMATION_SUFFIX, REPLACE_ANIMATION}
|
||||
export var debug_state: bool = false
|
||||
|
||||
var debug_state: bool = false
|
||||
|
||||
## These should be the original properties set when the modifier is created.
|
||||
# property changes can be applied over time but these are the instantiated values.
|
||||
var modifier_properties: ModifierProperties
|
||||
|
||||
## Animation modifier variables
|
||||
## The name of the animation that could be applied and starting frame
|
||||
var animation_name: String
|
||||
var starting_frame: int = 0
|
||||
##TODO: Animation speed
|
||||
export var animation_name: String
|
||||
|
||||
## Modification Type
|
||||
## if an animation is specified, the default behavior will be just to override
|
||||
## the state animation. Or perform a 'Replace Animation'
|
||||
var modifier_type = TYPE.NONE
|
||||
|
||||
var name :String = ''
|
||||
|
||||
# Move Speed in Pixels Per Second
|
||||
# These should only apply if Modification Type Set to None.
|
||||
# (But I'm not sure if I like that model.)
|
||||
#var move_speed: float
|
||||
#var move_speed_modifier: float = 0
|
||||
#var move_speed_modifier_decay: float = 0
|
||||
|
||||
var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
export(String, "None",
|
||||
"Exit Animation",
|
||||
"Animation Suffix",
|
||||
"Replace Animation") var modifier_type = "None"
|
||||
|
||||
export var starting_frame: int = 0
|
||||
export var move_speed: float = 60
|
||||
export var timeout_seconds: float = 0.0
|
||||
|
||||
# Attempting to use this as an animation suffix that can linger after
|
||||
# state transition like 'run-fire' to 'idle-fire' 'jump-fire' etc.
|
||||
#var animation_suffix: bool = false
|
||||
#var pre_append_animation: bool = false
|
||||
export var animation_suffix: bool = false
|
||||
export var pre_append_animation: bool = false
|
||||
|
||||
# not sure if I can do the array thing from state change. Maybe?
|
||||
# disabling this sequencing for now.
|
||||
|
|
@ -52,82 +37,32 @@ var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")
|
|||
# var animation_index: int = 0
|
||||
# var current_animation_sequence: int = 0
|
||||
|
||||
var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")
|
||||
|
||||
#var animation_sequence_timer: Timer
|
||||
|
||||
var state_timeout: Timer
|
||||
var timeout_seconds: float = 0.0
|
||||
|
||||
# Meant to be called on timeout or other counters this modifier may have.
|
||||
# Should be updated whenever modifier owner transfers
|
||||
var state_call_function: FuncRef
|
||||
|
||||
## Can't do it this way.
|
||||
#func copy_modifier() -> StateModifier:
|
||||
# var new_modifier = StateModifier.new()
|
||||
# new_modifier.ready(animation_name, modifier_type, timeout_seconds)
|
||||
#
|
||||
# return StateModifier.new()
|
||||
#
|
||||
func merge_modifier(merging_mod: ModifierProperties):
|
||||
if merging_mod.modifier_type != TYPE.NONE:
|
||||
print("Warning Merging modifier types that aren't set to 'none' is not supported!")
|
||||
return
|
||||
# Can't support timeouts or animation stuff right now.
|
||||
#timeout_seconds = merging_mod.timeout_seconds
|
||||
# move_speed = merging_mod.move_speed
|
||||
# gravity = merging_mod.gravity
|
||||
# move_speed_modifier = merging_mod.move_speed_modifier
|
||||
# move_speed_modifier_decay = merging_mod.move_speed_modifier_decay
|
||||
|
||||
|
||||
func get_modifier_properties() -> ModifierProperties:
|
||||
#( p_move_speed:float, p_gravity:int , p_move_acceleration , p_move_speed_modifier:float,
|
||||
# p_move_modifier_move_acceleration:float, p_jerk_factor: float):
|
||||
var mp = ModifierProperties.new( modifier_properties.move_speed,
|
||||
modifier_properties.gravity,
|
||||
modifier_properties.move_acceleration,
|
||||
modifier_properties.move_speed_modifier,
|
||||
modifier_properties.move_modifier_move_acceleration,
|
||||
modifier_properties.jerk_factor)
|
||||
mp.directional_modifier = modifier_properties.directional_modifier
|
||||
return mp
|
||||
|
||||
func ready(modifier_name:String, anim_name:String = '', type = TYPE.NONE, timeout : float = 0, parent:Node = null, function_name : String = "") -> Timer:
|
||||
name = modifier_name
|
||||
func _ready():
|
||||
# If somebody forgot to specify the type
|
||||
if anim_name != '' and type == TYPE.NONE:
|
||||
modifier_type = TYPE.REPLACE_ANIMATION
|
||||
animation_name = anim_name
|
||||
modifier_type = type
|
||||
# if parent != null and function_name != "":
|
||||
# state_call_function = funcref(parent, function_name)
|
||||
if animation_name != '' and modifier_type == "None":
|
||||
modifier_type = "Replace Animation"
|
||||
state_timeout = Timer.new()
|
||||
if timeout_seconds > 0:
|
||||
state_timeout.wait_time = timeout_seconds
|
||||
state_timeout.one_shot = true
|
||||
state_timeout.autostart = false
|
||||
add_child(state_timeout)
|
||||
|
||||
modifier_properties = ModifierProperties.new(0,0,0,0,0,0)
|
||||
func enter() -> void:
|
||||
if debug_state:
|
||||
print("Apply State Modifier: ", self.name)
|
||||
state_timeout.start()
|
||||
#modifier_stack_ref = state_modifiers
|
||||
return
|
||||
|
||||
if timeout > 0:
|
||||
state_timeout = Timer.new()
|
||||
state_timeout.wait_time = timeout
|
||||
state_timeout.one_shot = true
|
||||
state_timeout.autostart = false
|
||||
return state_timeout
|
||||
#add_child(state_timeout)
|
||||
#ModifierProperties.new()
|
||||
return null
|
||||
func exit() -> void:
|
||||
pass
|
||||
|
||||
|
||||
## Transfer and callback related methods. These sort of worked but I didn't end up using them
|
||||
## They're an interesting idea though.
|
||||
func transfer_owner(parent:Node):
|
||||
print("Modifier owner will now be: ", parent.name)
|
||||
state_call_function = funcref(parent, 'update_animation')
|
||||
|
||||
func _on_Timer_timeout():
|
||||
#print("Oh Crap! I can't beleive it worked")
|
||||
if state_call_function:
|
||||
if state_call_function.is_valid():
|
||||
state_call_function.call_func()
|
||||
else:
|
||||
print("Warning! Modifier timed out with no callback to alert.")
|
||||
else:
|
||||
print("Warning! no function applies.")
|
||||
func _update():
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
class_name ModifierProperties
|
||||
extends Reference
|
||||
|
||||
var modifier_type: int = 0
|
||||
#var timeout_seconds: float = 0.0
|
||||
|
||||
var move_speed: float = 0.0
|
||||
var move_acceleration: float = 0.0
|
||||
var move_speed_modifier: float = 0.0
|
||||
var move_modifier_move_acceleration: float = 0.0
|
||||
var jerk_factor: float = 0
|
||||
|
||||
var gravity:int = 0
|
||||
|
||||
# Bad name. Just means that it is intended to apply in a certain direction
|
||||
# (Positive or negative) not an offset of the existing values.
|
||||
var directional_modifier: bool = false
|
||||
|
||||
|
||||
func _init( p_move_speed:float, p_gravity:int , p_move_acceleration , p_move_speed_modifier:float,
|
||||
p_move_modifier_move_acceleration:float, p_jerk_factor: float):
|
||||
#timeout_seconds = p_timeout_seconds
|
||||
move_speed = p_move_speed
|
||||
move_acceleration = p_move_acceleration
|
||||
gravity = p_gravity
|
||||
move_speed_modifier = p_move_speed_modifier
|
||||
move_modifier_move_acceleration = p_move_modifier_move_acceleration
|
||||
jerk_factor = p_jerk_factor
|
||||
59
src/templates/Actor/ActorTemplate.gd
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
extends Actor
|
||||
|
||||
onready var actor_hurtbox = $Hurtbox_Component/CollisionShape2D
|
||||
|
||||
|
||||
#var sound_effects = preload("res://src/playerC/resources/sound_effects.tres")
|
||||
|
||||
func _ready() -> void:
|
||||
movement_state_machine.init_animated_actor(self, movement_animations, movement_component)
|
||||
|
||||
# Experimenting with sound based resources I did this and it worked
|
||||
#sound_effect_player.stream = sound_effects.sounds["pew"]
|
||||
#print(sounds.sounds["pew"])
|
||||
#sound_effects.play()
|
||||
|
||||
# Trying something new with a custom resourse.
|
||||
for i in SoundEffects:
|
||||
sound_effects_dict[i.animation_name + str(i.frame_number)] = i.sound
|
||||
print (sound_effects_dict)
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
movement_state_machine.process_input(event)
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
movement_state_machine.process_physics(delta)
|
||||
# #TODO: So much hack
|
||||
# if direction.x != 0:
|
||||
# gun.set_scale( Vector2(direction.x,1))
|
||||
|
||||
# Commented out to try parent transforms instead
|
||||
# if direction.x < 0:
|
||||
# var t = Transform2D()
|
||||
# # Translation
|
||||
# t.origin = Vector2(gun.offset_position.x * -1, gun.offset_position.y)
|
||||
# gun.transform = t
|
||||
# elif direction.x > 0:
|
||||
# var t = Transform2D()
|
||||
# # Translation
|
||||
# t.origin = Vector2(gun.offset_position.x, gun.offset_position.y)
|
||||
# gun.transform = t
|
||||
|
||||
# Attempting a Kinematic2D level scale for flip operations instead.
|
||||
#self.transform
|
||||
#self.scale.x = -1
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
movement_component.process(delta)
|
||||
movement_state_machine.process_frame(delta)
|
||||
play_sound_frame(movement_animations.animation , movement_animations.frame)
|
||||
|
||||
|
||||
##TODO: I don't like player class having do do this.
|
||||
## Figure out how to programatically signal subscribe
|
||||
#func _on_AnimatedSprite_animation_finished():
|
||||
# if movement_animations.frames.get_animation_loop(movement_animations.animation) == false:
|
||||
# movement_state_machine.current_state.animation_index += 1
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=17 format=2]
|
||||
[gd_scene load_steps=18 format=2]
|
||||
|
||||
[ext_resource path="res://src/components/Hurtbox_Component.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://src/state_machine_animated_actor.gd" type="Script" id=2]
|
||||
|
|
@ -41,6 +41,9 @@ animations = [ {
|
|||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=74]
|
||||
extents = Vector2( 14, 18.5 )
|
||||
|
||||
[sub_resource type="CircleShape2D" id=82]
|
||||
|
||||
[node name="ActorTemplate" type="KinematicBody2D"]
|
||||
|
|
@ -49,7 +52,7 @@ script = ExtResource( 8 )
|
|||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
frames = SubResource( 75 )
|
||||
frame = 3
|
||||
frame = 4
|
||||
playing = true
|
||||
flip_h = true
|
||||
__meta__ = {
|
||||
|
|
@ -65,6 +68,10 @@ __meta__ = {
|
|||
}
|
||||
}
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 0, -3.5 )
|
||||
shape = SubResource( 74 )
|
||||
|
||||
[node name="movement_component" type="Node" parent="."]
|
||||
script = ExtResource( 5 )
|
||||
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
class_name Interactable
|
||||
extends Area2D
|
||||
|
||||
## I'm not quite sure what to do with this yet but the idea is having an
|
||||
# area2d that detects not just a body entering a certain zone but triggering an
|
||||
# interract status. For a player this would probably be pressing a button.
|
||||
# the component can perhaps have a prompt of some sort to indicate what they're
|
||||
# supposed to do. Additionaly the interraction could perhaps trigger some
|
||||
# sort of animation when the action is performed.
|
||||
|
||||
# This may have to be implemented as a bi-directional mediator pattern where
|
||||
# the player node is given some sort of call back upon entering the region and
|
||||
# when it happens it fires off that call back.
|
||||
# This means that whatever entity that is supposed to interract with these
|
||||
# objects should also have a receiver function of some kind.
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
export var type_name :String
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
func trigger_interaction():
|
||||
# This is something that should maybe be extended for every differant interactible.
|
||||
# They could inherit from this base class and implement this function.
|
||||
# sprite.frame = 1
|
||||
pass
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
#func _process(delta):
|
||||
# pass
|
||||
|
||||
# When a body enters this area
|
||||
# We want to give that body (a player I assume) a callback or a reference to this
|
||||
# Node.
|
||||
func _on_Interactable_Component_body_entered(body):
|
||||
var colliding_node = body
|
||||
if colliding_node.has_node("Interactable_Receiver"):
|
||||
colliding_node.get_node("Interactable_Receiver").register_interactable(self)
|
||||
|
||||
func _on_Interactable_Component_body_exited(body):
|
||||
var colliding_node = body
|
||||
if colliding_node.has_node("Interactable_Receiver"):
|
||||
colliding_node.get_node("Interactable_Receiver").remove_interactable(self)
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://src/templates/Interactable/Interactable_Component.gd" type="Script" id=2]
|
||||
|
||||
[node name="Interactable_Template" type="Area2D"]
|
||||
script = ExtResource( 2 )
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_Interactable_Component_body_entered"]
|
||||
[connection signal="body_exited" from="." to="." method="_on_Interactable_Component_body_exited"]
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
class_name Interactable_Receiver
|
||||
extends Node2D
|
||||
|
||||
# This may be stupid but we're going to have two kinds of callbacks here.
|
||||
# It's going to be up to the parent/actor/kinematicbody2d/whatever to know
|
||||
# what conditions have to be met before being able to call that interactible's
|
||||
# function.
|
||||
# This is a nice and generic interface that I might be able to use for
|
||||
# things like opening doors in a level, opening chests/flipping switches etc.
|
||||
|
||||
# This node can keep an array of various interactibles within a level
|
||||
# and provide several helper functions for managing them perhaps.
|
||||
|
||||
export(String) var interactable_parent_callback = ""
|
||||
|
||||
var call_function: FuncRef
|
||||
|
||||
var interactable_function_callables = []
|
||||
|
||||
# Declare member variables here. Examples:
|
||||
# var a = 2
|
||||
# var b = "text"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
if interactable_parent_callback:
|
||||
call_function = funcref(owner, interactable_parent_callback)
|
||||
else:
|
||||
print("Warning: No interactable receiver function defined on ", owner.name)
|
||||
|
||||
# Switching to a new model that starts with Hitbox
|
||||
func register_interactable(sender):
|
||||
print("Interactable Registered " + sender.name)
|
||||
if call_function.is_valid():
|
||||
var should_register: bool = call_function.call_func(sender)
|
||||
if should_register:
|
||||
interactable_function_callables.append(sender)
|
||||
else:
|
||||
print("Interactable handled by Player")
|
||||
|
||||
func remove_interactable(sender):
|
||||
print("Interactable Removal " + sender.name)
|
||||
if interactable_function_callables.has(sender):
|
||||
var sender_index = interactable_function_callables.rfind(sender)
|
||||
if sender_index != -1:
|
||||
interactable_function_callables.remove(sender_index)
|
||||
|
||||