Various debugging for 4.3 import, mostly collision shapes and ysort

This commit is contained in:
Alan Youngblood 2025-01-05 18:27:51 -05:00
parent 01051a3205
commit 41db52db5c
6 changed files with 165 additions and 127 deletions

View File

@ -18,13 +18,13 @@ var knockback = Vector2.ZERO
var state = IDLE
@onready var sprite = $AnimatedSprite2D
@onready var stats = $Stats
@onready var playerDetectionZone = $PlayerDetectionZone
@onready var hurtbox = $Hurtbox
@onready var softCollision = $SoftCollision
@onready var wanderController = $WanderController
@onready var animationPlayer = $AnimationPlayer
@onready var sprite = get_node("AnimatedSprite2D")
@onready var stats = get_node("Stats")
@onready var playerDetectionZone = get_node("PlayerDetectionZone")
@onready var hurtbox = get_node("Hurtbox")
@onready var softCollision = get_node("SoftCollision")
@onready var wanderController = get_node("WanderController")
@onready var animationPlayer = get_node("AnimationPlayer")
func _ready():
state = pick_new_state([IDLE,WANDER])

View File

@ -1,73 +1,88 @@
[gd_scene load_steps=26 format=2]
[gd_scene load_steps=27 format=3 uid="uid://cqhkluf5uxn11"]
[ext_resource path="res://Enemies/Bat.png" type="Texture2D" id=1]
[ext_resource path="res://Shadows/SmallShadow.png" type="Texture2D" id=2]
[ext_resource path="res://Overlap/Hurtbox.tscn" type="PackedScene" id=3]
[ext_resource path="res://Enemies/Bat.gd" type="Script" id=4]
[ext_resource path="res://Stats.tscn" type="PackedScene" id=5]
[ext_resource path="res://Enemies/PlayerDetectionZone.tscn" type="PackedScene" id=6]
[ext_resource path="res://Overlap/Hitbox.tscn" type="PackedScene" id=7]
[ext_resource path="res://Overlap/SoftCollision.tscn" type="PackedScene" id=8]
[ext_resource path="res://Overlap/WanderController.tscn" type="PackedScene" id=9]
[ext_resource path="res://WhiteColor_shader.tres" type="Shader" id=10]
[ext_resource type="Texture2D" uid="uid://sia0qera1a0e" path="res://Enemies/Bat.png" id="1"]
[ext_resource type="Texture2D" uid="uid://cp46k48acfh6k" path="res://Shadows/SmallShadow.png" id="2"]
[ext_resource type="PackedScene" path="res://Overlap/Hurtbox.tscn" id="3"]
[ext_resource type="Script" path="res://Enemies/Bat.gd" id="4"]
[ext_resource type="PackedScene" path="res://Stats.tscn" id="5"]
[ext_resource type="PackedScene" path="res://Enemies/PlayerDetectionZone.tscn" id="6"]
[ext_resource type="PackedScene" path="res://Overlap/Hitbox.tscn" id="7"]
[ext_resource type="PackedScene" path="res://Overlap/SoftCollision.tscn" id="8"]
[ext_resource type="PackedScene" path="res://Overlap/WanderController.tscn" id="9"]
[ext_resource type="Shader" uid="uid://c8kh0c6pydtym" path="res://WhiteColor_shader.tres" id="10"]
[sub_resource type="ShaderMaterial" id=12]
[sub_resource type="ShaderMaterial" id="12"]
resource_local_to_scene = true
shader = ExtResource( 10 )
shader_param/active = false
shader = ExtResource("10")
shader_parameter/active = false
[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
[sub_resource type="AtlasTexture" id="1"]
atlas = ExtResource("1")
region = Rect2(0, 0, 16, 24)
[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 1 )
[sub_resource type="AtlasTexture" id="2"]
atlas = ExtResource("1")
region = Rect2(16, 0, 16, 24)
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 1 )
[sub_resource type="AtlasTexture" id="3"]
atlas = ExtResource("1")
region = Rect2(32, 0, 16, 24)
[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 1 )
[sub_resource type="AtlasTexture" id="4"]
atlas = ExtResource("1")
region = Rect2(48, 0, 16, 24)
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 1 )
[sub_resource type="AtlasTexture" id="5"]
atlas = ExtResource("1")
region = Rect2(64, 0, 16, 24)
[sub_resource type="SpriteFrames" id=6]
[sub_resource type="SpriteFrames" id="6"]
animations = [{
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
"frames": [{
"duration": 1.0,
"texture": SubResource("1")
}, {
"duration": 1.0,
"texture": SubResource("2")
}, {
"duration": 1.0,
"texture": SubResource("3")
}, {
"duration": 1.0,
"texture": SubResource("4")
}, {
"duration": 1.0,
"texture": SubResource("5")
}],
"loop": true,
"name": "Fly",
"name": &"Fly",
"speed": 10.0
}]
[sub_resource type="CircleShape2D" id=7]
[sub_resource type="CircleShape2D" id="7"]
radius = 4.12311
[sub_resource type="CapsuleShape2D" id=8]
radius = 7.0
height = 6.0
[sub_resource type="CapsuleShape2D" id="8"]
radius = 4.0
height = 16.0
[sub_resource type="CircleShape2D" id=9]
[sub_resource type="CircleShape2D" id="9"]
radius = 61.0328
[sub_resource type="CircleShape2D" id=10]
[sub_resource type="CircleShape2D" id="10"]
radius = 5.0
[sub_resource type="CircleShape2D" id=11]
[sub_resource type="CircleShape2D" id="11"]
radius = 5.0
[sub_resource type="Animation" id=13]
[sub_resource type="Animation" id="13"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:material:shader_param/active")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
@ -75,16 +90,16 @@ tracks/0/keys = {
"values": [false]
}
[sub_resource type="Animation" id=14]
[sub_resource type="Animation" id="14"]
resource_name = "Start"
length = 0.2
loop = true
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:material:shader_param/active")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1),
"transitions": PackedFloat32Array(1, 1),
@ -92,15 +107,15 @@ tracks/0/keys = {
"values": [true, false]
}
[sub_resource type="Animation" id=15]
[sub_resource type="Animation" id="15"]
resource_name = "Stop"
length = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimatedSprite2D:material:shader_param/active")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
@ -108,62 +123,73 @@ tracks/0/keys = {
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_cy3aa"]
_data = {
"RESET": SubResource("13"),
"Start": SubResource("14"),
"Stop": SubResource("15")
}
[node name="Bat" type="CharacterBody2D"]
collision_layer = 16
script = ExtResource( 4 )
script = ExtResource("4")
ACCELERATION = 1800
MAX_SPEED = 300
FRICTION = 33
WANDER_TARGET_RANGE = 24
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
material = SubResource( 12 )
frames = SubResource( 6 )
animation = "Fly"
frame = 3
playing = true
material = SubResource("12")
sprite_frames = SubResource("6")
animation = &"Fly"
autoplay = "Fly"
frame = 1
frame_progress = 0.870083
offset = Vector2(0, -12)
[node name="ShadowSprite" type="Sprite2D" parent="."]
texture = ExtResource( 2 )
texture = ExtResource("2")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
shape = SubResource( 7 )
shape = SubResource("7")
[node name="Hurtbox" parent="." instance=ExtResource( 3 )]
visible = false
[node name="Hurtbox" parent="." instance=ExtResource("3")]
collision_layer = 8
[node name="CollisionShape2D" parent="Hurtbox" index="0"]
position = Vector2(0, -14)
shape = SubResource( 8 )
shape = SubResource("8")
[node name="Stats" parent="." instance=ExtResource( 5 )]
[node name="Stats" parent="." instance=ExtResource("5")]
max_health = 2
[node name="PlayerDetectionZone" parent="." instance=ExtResource( 6 )]
[node name="PlayerDetectionZone" parent="." instance=ExtResource("6")]
visible = false
[node name="CollisionShape2D" parent="PlayerDetectionZone" index="0"]
modulate = Color(1, 1, 1, 0.258824)
shape = SubResource( 9 )
shape = SubResource("9")
[node name="Hitbox" parent="." instance=ExtResource( 7 )]
[node name="Hitbox" parent="." instance=ExtResource("7")]
visible = false
collision_mask = 4
[node name="CollisionShape2D" parent="Hitbox" index="0"]
position = Vector2(0, -15)
shape = SubResource( 10 )
shape = SubResource("10")
[node name="SoftCollision" parent="." instance=ExtResource( 8 )]
[node name="SoftCollision" parent="." instance=ExtResource("8")]
[node name="CollisionShape2D" parent="SoftCollision" index="0"]
shape = SubResource( 11 )
shape = SubResource("11")
[node name="WanderController" parent="." instance=ExtResource( 9 )]
[node name="WanderController" parent="." instance=ExtResource("9")]
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 13 )
anims/Start = SubResource( 14 )
anims/Stop = SubResource( 15 )
libraries = {
"": SubResource("AnimationLibrary_cy3aa")
}
[connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"]
[connection signal="invincibility_ended" from="Hurtbox" to="." method="_on_Hurtbox_invincibility_ended"]

View File

@ -15,8 +15,8 @@ shader = ExtResource("9")
shader_parameter/active = true
[sub_resource type="CapsuleShape2D" id="1"]
radius = 2.0
height = 4.0
radius = 3.0
height = 12.0
[sub_resource type="Animation" id="27"]
resource_name = "AttackDown"
@ -427,7 +427,7 @@ tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.499905),
"times": PackedFloat32Array(0.5),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
@ -476,7 +476,7 @@ tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.500823),
"times": PackedFloat32Array(0.5),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
@ -525,7 +525,7 @@ tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.500364),
"times": PackedFloat32Array(0.5),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
@ -570,7 +570,7 @@ tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.501281),
"times": PackedFloat32Array(0.5),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
@ -819,8 +819,8 @@ radius = 6.0
height = 12.0
[sub_resource type="CapsuleShape2D" id="52"]
radius = 3.0
height = 6.0
radius = 5.0
height = 14.0
[sub_resource type="Animation" id="56"]
length = 0.001

View File

@ -1,15 +1,15 @@
[gd_scene load_steps=16 format=3 uid="uid://ckanm4arl1wqs"]
[ext_resource type="PackedScene" path="res://World/Bush.tscn" id="1"]
[ext_resource type="PackedScene" uid="uid://b33u2ew1b5cqw" path="res://World/Bush.tscn" id="1"]
[ext_resource type="PackedScene" uid="uid://clt214vwnqrba" path="res://Player/Player.tscn" id="2"]
[ext_resource type="Texture2D" uid="uid://cti8so4muh5ky" path="res://World/GrassBackground.png" id="3"]
[ext_resource type="Texture2D" uid="uid://b8ykt4vtn46df" path="res://World/DirtTileset.png" id="4"]
[ext_resource type="Texture2D" uid="uid://yx0d4d27sbbs" path="res://World/CliffTileset.png" id="5"]
[ext_resource type="PackedScene" path="res://World/Grass.tscn" id="6"]
[ext_resource type="PackedScene" path="res://touch_controls/TouchControls.tscn" id="7"]
[ext_resource type="PackedScene" path="res://Enemies/Bat.tscn" id="8"]
[ext_resource type="PackedScene" uid="uid://cqhkluf5uxn11" path="res://Enemies/Bat.tscn" id="8"]
[ext_resource type="PackedScene" path="res://UI/HealthUI.tscn" id="9"]
[ext_resource type="PackedScene" path="res://World/Tree.tscn" id="10"]
[ext_resource type="PackedScene" uid="uid://cwjuswdufk2f7" path="res://World/Tree.tscn" id="10"]
[ext_resource type="PackedScene" path="res://Camera2D.tscn" id="11"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_kcrgu"]
@ -36,20 +36,30 @@ region_rect = Rect2(0, 0, 1424, 912)
tile_set = SubResource("1")
format = 2
[node name="Layer1" type="TileMapLayer" parent="DirtPathTileMap"]
use_parent_material = true
tile_set = SubResource("1")
[node name="DirtCliffTileMap" type="TileMap" parent="."]
tile_set = SubResource("2")
format = 2
[node name="Layer1" type="TileMapLayer" parent="DirtCliffTileMap"]
use_parent_material = true
tile_set = SubResource("2")
[node name="Camera2D" parent="." instance=ExtResource("11")]
position = Vector2(167, 111)
[node name="TopLeft" parent="Camera2D/Limits" index="0"]
position = Vector2(-32, -352)
gizmo_extents = 15.2
[node name="BottomRight" parent="Camera2D/Limits" index="1"]
position = Vector2(872, 544)
[node name="Node2D" type="Node2D" parent="."]
y_sort_enabled = true
[node name="Player" parent="Node2D" instance=ExtResource("2")]
position = Vector2(167, 111)
@ -58,6 +68,7 @@ position = Vector2(167, 111)
remote_path = NodePath("../../../Camera2D")
[node name="Bushes" type="Node2D" parent="Node2D"]
y_sort_enabled = true
[node name="Bush" parent="Node2D/Bushes" instance=ExtResource("1")]
position = Vector2(62, 58)
@ -119,6 +130,7 @@ position = Vector2(48, 112)
position = Vector2(128, 121)
[node name="Trees" type="Node2D" parent="Node2D"]
y_sort_enabled = true
[node name="Tree" parent="Node2D/Trees" instance=ExtResource("10")]
position = Vector2(127, 40)
@ -207,7 +219,7 @@ layout_mode = 3
anchors_preset = 0
offset_left = 0.0
offset_top = 0.0
offset_right = 122.0
offset_right = 56.0
offset_bottom = 25.0
[editable path="Camera2D"]

View File

@ -1,22 +1,22 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=4 format=3 uid="uid://b33u2ew1b5cqw"]
[ext_resource path="res://World/Bush.png" type="Texture2D" id=1]
[ext_resource path="res://Shadows/LargeShadow.png" type="Texture2D" id=2]
[ext_resource type="Texture2D" uid="uid://bppe8xi57e01x" path="res://World/Bush.png" id="1"]
[ext_resource type="Texture2D" uid="uid://cgr81av5lcoki" path="res://Shadows/LargeShadow.png" id="2"]
[sub_resource type="CapsuleShape2D" id=1]
radius = 7.99998
height = 12.0
[sub_resource type="CapsuleShape2D" id="1"]
radius = 7.0
height = 26.0
[node name="Bush" type="StaticBody2D"]
[node name="ShadowSprite" type="Sprite2D" parent="."]
position = Vector2(0, 6)
texture = ExtResource( 2 )
texture = ExtResource("2")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource( 1 )
texture = ExtResource("1")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, 2.294 )
position = Vector2(0, 5)
rotation = -1.57079
shape = SubResource( 1 )
shape = SubResource("1")

View File

@ -1,22 +1,22 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=4 format=3 uid="uid://cwjuswdufk2f7"]
[ext_resource path="res://Shadows/LargeShadow.png" type="Texture2D" id=1]
[ext_resource path="res://World/Tree.png" type="Texture2D" id=2]
[ext_resource type="Texture2D" uid="uid://cgr81av5lcoki" path="res://Shadows/LargeShadow.png" id="1"]
[ext_resource type="Texture2D" uid="uid://cilct1beq1g2w" path="res://World/Tree.png" id="2"]
[sub_resource type="CapsuleShape2D" id=1]
radius = 9.0
height = 8.0
[sub_resource type="CapsuleShape2D" id="1"]
radius = 7.99999
height = 26.0
[node name="Tree" type="StaticBody2D"]
[node name="ShadowSprite" type="Sprite2D" parent="."]
texture = ExtResource( 1 )
texture = ExtResource("1")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(0, -16)
texture = ExtResource( 2 )
texture = ExtResource("2")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -1)
rotation = 1.5708
shape = SubResource( 1 )
shape = SubResource("1")