Various debugging for 4.3 import, mostly collision shapes and ysort
This commit is contained in:
@ -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])
|
||||
|
@ -1,169 +1,195 @@
|
||||
[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 )
|
||||
region = Rect2( 0, 0, 16, 24 )
|
||||
[sub_resource type="AtlasTexture" id="1"]
|
||||
atlas = ExtResource("1")
|
||||
region = Rect2(0, 0, 16, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id=2]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 16, 0, 16, 24 )
|
||||
[sub_resource type="AtlasTexture" id="2"]
|
||||
atlas = ExtResource("1")
|
||||
region = Rect2(16, 0, 16, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id=3]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 32, 0, 16, 24 )
|
||||
[sub_resource type="AtlasTexture" id="3"]
|
||||
atlas = ExtResource("1")
|
||||
region = Rect2(32, 0, 16, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id=4]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 48, 0, 16, 24 )
|
||||
[sub_resource type="AtlasTexture" id="4"]
|
||||
atlas = ExtResource("1")
|
||||
region = Rect2(48, 0, 16, 24)
|
||||
|
||||
[sub_resource type="AtlasTexture" id=5]
|
||||
atlas = ExtResource( 1 )
|
||||
region = Rect2( 64, 0, 16, 24 )
|
||||
[sub_resource type="AtlasTexture" id="5"]
|
||||
atlas = ExtResource("1")
|
||||
region = Rect2(64, 0, 16, 24)
|
||||
|
||||
[sub_resource type="SpriteFrames" id=6]
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
|
||||
[sub_resource type="SpriteFrames" id="6"]
|
||||
animations = [{
|
||||
"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 ),
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [ false ]
|
||||
"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 ),
|
||||
"times": PackedFloat32Array(0, 0.1),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [ true, false ]
|
||||
"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 ),
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [ false ]
|
||||
"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
|
||||
offset = Vector2( 0, -12 )
|
||||
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 )
|
||||
position = Vector2(0, -14)
|
||||
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 )
|
||||
modulate = Color(1, 1, 1, 0.258824)
|
||||
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 )
|
||||
position = Vector2(0, -15)
|
||||
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"]
|
||||
|
Reference in New Issue
Block a user