Moved enemies, finally
This commit is contained in:
parent
5dcf0bdf35
commit
fd56f64ae0
47
enemies/Arnold/Arnold.gd
Normal file
47
enemies/Arnold/Arnold.gd
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
extends CharacterBody2D
|
||||||
|
|
||||||
|
@onready var stm := $StateMachine
|
||||||
|
|
||||||
|
@onready var bounce := $StateMachine/Bounce
|
||||||
|
@onready var fly := $StateMachine/Fly
|
||||||
|
|
||||||
|
# final time = time +/- (random(-1, 1) * variation)
|
||||||
|
@export var bounce_time: float
|
||||||
|
@export var bounce_time_variation: float
|
||||||
|
@export var fly_time: float
|
||||||
|
@export var fly_time_variation: float
|
||||||
|
|
||||||
|
var state_time_tmp := 0.0
|
||||||
|
|
||||||
|
@export var bounce_angle: float
|
||||||
|
|
||||||
|
var rng := RandomNumberGenerator.new()
|
||||||
|
|
||||||
|
func current_state():
|
||||||
|
return stm.state
|
||||||
|
|
||||||
|
func get_new_dir():
|
||||||
|
return Vector2.from_angle(rng.randf() * PI*2)
|
||||||
|
|
||||||
|
func get_new_bounce_dir():
|
||||||
|
if rng.randi_range(0, 1) == 1:
|
||||||
|
return Vector2.from_angle((-PI/2) + bounce_angle)
|
||||||
|
else:
|
||||||
|
return Vector2.from_angle((-PI/2) + (-bounce_angle))
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
state_time_tmp = fly_time + rng.randf() * fly_time_variation
|
||||||
|
current_state().enter(get_new_dir())
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
if state_time_tmp <= 0:
|
||||||
|
if current_state() in [bounce]:
|
||||||
|
stm.transition(fly, get_new_dir())
|
||||||
|
state_time_tmp = fly_time + rng.randf() * fly_time_variation
|
||||||
|
elif current_state() in [fly]:
|
||||||
|
stm.transition(bounce, get_new_bounce_dir())
|
||||||
|
state_time_tmp = bounce_time + rng.randf() * bounce_time_variation
|
||||||
|
else:
|
||||||
|
state_time_tmp -= delta
|
||||||
|
|
||||||
|
current_state().update(delta)
|
58
enemies/Arnold/Arnold.tscn
Normal file
58
enemies/Arnold/Arnold.tscn
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
[gd_scene load_steps=9 format=3 uid="uid://bksvm8xw0pvxp"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://test_levels/Arnold/Arnold.gd" id="1_1ci4u"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d4mwda7b1uud7" path="res://global/Actor.tscn" id="2_ipn6e"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/StateMachine.gd" id="3_8ljb7"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/Fly.gd" id="4_f4cei"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bgw5itdndav4s" path="res://icon.svg" id="5_bedbx"]
|
||||||
|
[ext_resource type="Shape2D" uid="uid://dmxy3ej1fcl68" path="res://test_levels/Arnold/Shape.tres" id="6_q1c6y"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/misc/HitBox.gd" id="7_j8c62"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://vryobnt2swfg" path="res://state_machine/misc/HurtBox.tscn" id="8_ww0gi"]
|
||||||
|
|
||||||
|
[node name="Arnold" type="CharacterBody2D" groups=["debug_enemy_respawn"]]
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 9
|
||||||
|
script = ExtResource("1_1ci4u")
|
||||||
|
bounce_time = 5.0
|
||||||
|
bounce_time_variation = 1.0
|
||||||
|
fly_time = 3.0
|
||||||
|
fly_time_variation = 0.5
|
||||||
|
bounce_angle = 0.523
|
||||||
|
|
||||||
|
[node name="Actor" parent="." instance=ExtResource("2_ipn6e")]
|
||||||
|
original_scene = "res://test_levels/Arnold/Arnold.tscn"
|
||||||
|
|
||||||
|
[node name="StateMachine" type="Node" parent="."]
|
||||||
|
script = ExtResource("3_8ljb7")
|
||||||
|
initial_state = NodePath("Fly")
|
||||||
|
dont_enter_at_init = true
|
||||||
|
|
||||||
|
[node name="Bounce" type="Node" parent="StateMachine"]
|
||||||
|
script = ExtResource("4_f4cei")
|
||||||
|
speed = 200.0
|
||||||
|
speed_variation = 30.0
|
||||||
|
|
||||||
|
[node name="Fly" type="Node" parent="StateMachine"]
|
||||||
|
script = ExtResource("4_f4cei")
|
||||||
|
speed = 100.0
|
||||||
|
|
||||||
|
[node name="Icon" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("5_bedbx")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = ExtResource("6_q1c6y")
|
||||||
|
|
||||||
|
[node name="HitBox" type="Area2D" parent="."]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 4
|
||||||
|
script = ExtResource("7_j8c62")
|
||||||
|
|
||||||
|
[node name="Shape" type="CollisionShape2D" parent="HitBox"]
|
||||||
|
shape = ExtResource("6_q1c6y")
|
||||||
|
|
||||||
|
[node name="HurtBox" parent="." instance=ExtResource("8_ww0gi")]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="HurtBox"]
|
||||||
|
shape = ExtResource("6_q1c6y")
|
||||||
|
|
||||||
|
[connection signal="hurt" from="HurtBox" to="Actor" method="_on_hurt_box_hurt"]
|
4
enemies/Arnold/Shape.tres
Normal file
4
enemies/Arnold/Shape.tres
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[gd_resource type="RectangleShape2D" format=3 uid="uid://d27jalwoj4ky"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
size = Vector2(128, 128)
|
76
enemies/Bingus/Bingus.gd
Normal file
76
enemies/Bingus/Bingus.gd
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
extends CharacterBody2D
|
||||||
|
|
||||||
|
@onready var stm := $StateMachine
|
||||||
|
@onready var detect_box := $DetectBox
|
||||||
|
@onready var attack_rage := $AttackRange
|
||||||
|
@onready var sword := $Skamtebord
|
||||||
|
|
||||||
|
@onready var run := $StateMachine/Run
|
||||||
|
@onready var air := $StateMachine/Air
|
||||||
|
@onready var idle := $StateMachine/Idle
|
||||||
|
@onready var follow := $StateMachine/Follow
|
||||||
|
@onready var attack := $StateMachine/Attack
|
||||||
|
|
||||||
|
@export var wait_low: float
|
||||||
|
@export var wait_high: float
|
||||||
|
var wait_tmp: float
|
||||||
|
|
||||||
|
@export var walk_range: float
|
||||||
|
|
||||||
|
var random := RandomNumberGenerator.new()
|
||||||
|
var original_pos: Vector2
|
||||||
|
|
||||||
|
func current_state():
|
||||||
|
return stm.state
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
original_pos = position
|
||||||
|
if random.randi_range(0, 1) == 0:
|
||||||
|
run.direction = -1
|
||||||
|
original_pos.x += walk_range/2
|
||||||
|
else:
|
||||||
|
run.direction = 1
|
||||||
|
original_pos.x -= walk_range/2
|
||||||
|
|
||||||
|
func start_wait():
|
||||||
|
wait_tmp = random.randf_range(wait_low, wait_high)
|
||||||
|
stm.transition(idle)
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
if current_state() in [run] && !is_on_floor():
|
||||||
|
stm.transition(air)
|
||||||
|
if current_state() in [air] && is_on_floor():
|
||||||
|
stm.transition(run)
|
||||||
|
if current_state() in [run]:
|
||||||
|
if position.x < original_pos.x - walk_range:
|
||||||
|
run.direction = 1
|
||||||
|
start_wait()
|
||||||
|
return
|
||||||
|
if position.x > original_pos.x + walk_range:
|
||||||
|
run.direction = -1
|
||||||
|
start_wait()
|
||||||
|
return
|
||||||
|
if current_state() in [idle]:
|
||||||
|
if wait_tmp <= 0:
|
||||||
|
original_pos = position
|
||||||
|
stm.transition(run)
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
wait_tmp -= delta
|
||||||
|
if current_state() in [run, idle]:
|
||||||
|
if detect_box.tracked != null:
|
||||||
|
stm.transition(follow, detect_box.tracked)
|
||||||
|
if current_state() in [follow] && !is_on_floor():
|
||||||
|
stm.transition(air)
|
||||||
|
if current_state() in [follow] && detect_box.tracked == null:
|
||||||
|
stm.transition(air)
|
||||||
|
if current_state() in [follow] && attack_rage.tracked != null:
|
||||||
|
var diff = attack_rage.tracked.global_position.x - global_position.x
|
||||||
|
if diff > 0:
|
||||||
|
sword.scale.x = 1
|
||||||
|
if diff < 0:
|
||||||
|
sword.scale.x = -1
|
||||||
|
stm.transition(attack, "SwordAttack")
|
||||||
|
if current_state() in [attack] && current_state().done:
|
||||||
|
stm.transition(air)
|
||||||
|
current_state().update(delta)
|
249
enemies/Bingus/Bingus.tscn
Normal file
249
enemies/Bingus/Bingus.tscn
Normal file
|
@ -0,0 +1,249 @@
|
||||||
|
[gd_scene load_steps=30 format=3 uid="uid://71j46nh73c34"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://test_levels/Bingus/Bingus.gd" id="1_dxbqk"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d4mwda7b1uud7" path="res://global/Actor.tscn" id="2_ct6cu"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/StateMachine.gd" id="3_pdubj"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/Run.gd" id="4_1uiew"]
|
||||||
|
[ext_resource type="Resource" uid="uid://cdynh4jxcd7nf" path="res://test_levels/Bingus/run-stats.tres" id="5_ilrw2"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/Air.gd" id="6_ddk56"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/misc/RunStats.gd" id="7_31kt0"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/Idle.gd" id="8_ychal"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/Follow.gd" id="9_jk21m"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/Attack.gd" id="10_y7j8d"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bgw5itdndav4s" path="res://icon.svg" id="11_g0hh5"]
|
||||||
|
[ext_resource type="Shape2D" uid="uid://dtwp5o51vl44k" path="res://test_levels/Bingus/shape.tres" id="12_3omr2"]
|
||||||
|
[ext_resource type="Script" path="res://test_levels/Bingus/ToolWalkingRange.gd" id="13_52xwv"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/misc/HitBox.gd" id="14_fi5h3"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://vryobnt2swfg" path="res://state_machine/misc/HurtBox.tscn" id="15_crj2h"]
|
||||||
|
[ext_resource type="Script" path="res://state_machine/misc/DetectBox.gd" id="16_lcoe5"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_msnum"]
|
||||||
|
min_value = -200.0
|
||||||
|
_data = [Vector2(0, -99.5), 0.0, -246.682, 0, 1, Vector2(0.407407, -200), 0.0, 0.0, 0, 0, Vector2(1, -99.5), 169.594, 0.0, 1, 0]
|
||||||
|
point_count = 3
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_5vlwd"]
|
||||||
|
_data = [Vector2(0.353474, 0.445455), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 1
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_77b36"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_716lq"]
|
||||||
|
|
||||||
|
[sub_resource type="Resource" id="Resource_hmkwm"]
|
||||||
|
script = ExtResource("7_31kt0")
|
||||||
|
accel_curve = SubResource("Curve_5vlwd")
|
||||||
|
turn_curve = SubResource("Curve_716lq")
|
||||||
|
stop_curve = SubResource("Curve_77b36")
|
||||||
|
time = 1.0
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_0konv"]
|
||||||
|
max_value = 200.0
|
||||||
|
_data = [Vector2(0, 176.364), 0.0, 0.0, 0, 0, Vector2(0.637168, 129.091), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 2
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_7ysxr"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Skamtebord:visible")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("Skamtebord/CollisionShape2D:disabled")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_881mq"]
|
||||||
|
resource_name = "SwordAttack"
|
||||||
|
tracks/0/type = "bezier"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Skamtebord:rotation")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"handle_modes": PackedInt32Array(0, 0),
|
||||||
|
"points": PackedFloat32Array(-0.603884, -0.25, 0, 0.25, 0, 0.502655, -0.25, 0, 0.25, 0),
|
||||||
|
"times": PackedFloat32Array(0, 0.3)
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("Skamtebord:visible")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.3),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true, false]
|
||||||
|
}
|
||||||
|
tracks/2/type = "value"
|
||||||
|
tracks/2/imported = false
|
||||||
|
tracks/2/enabled = true
|
||||||
|
tracks/2/path = NodePath("Skamtebord/CollisionShape2D:disabled")
|
||||||
|
tracks/2/interp = 1
|
||||||
|
tracks/2/loop_wrap = true
|
||||||
|
tracks/2/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.3),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [false, true]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_t2tep"]
|
||||||
|
_data = {
|
||||||
|
"RESET": SubResource("Animation_7ysxr"),
|
||||||
|
"SwordAttack": SubResource("Animation_881mq")
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_d11af"]
|
||||||
|
size = Vector2(233.625, 47)
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_i74o8"]
|
||||||
|
radius = 283.007
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_pv3id"]
|
||||||
|
radius = 373.771
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_602j6"]
|
||||||
|
radius = 82.0
|
||||||
|
height = 288.0
|
||||||
|
|
||||||
|
[node name="Bingus" type="CharacterBody2D" groups=["debug_enemy_respawn"]]
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 9
|
||||||
|
script = ExtResource("1_dxbqk")
|
||||||
|
wait_low = 1.0
|
||||||
|
wait_high = 3.0
|
||||||
|
walk_range = 400.0
|
||||||
|
|
||||||
|
[node name="Actor" parent="." instance=ExtResource("2_ct6cu")]
|
||||||
|
original_scene = "res://test_levels/Bingus/Bingus.tscn"
|
||||||
|
|
||||||
|
[node name="StateMachine" type="Node" parent="."]
|
||||||
|
script = ExtResource("3_pdubj")
|
||||||
|
initial_state = NodePath("Run")
|
||||||
|
|
||||||
|
[node name="Run" type="Node" parent="StateMachine"]
|
||||||
|
script = ExtResource("4_1uiew")
|
||||||
|
run_stats = ExtResource("5_ilrw2")
|
||||||
|
|
||||||
|
[node name="Air" type="Node" parent="StateMachine"]
|
||||||
|
script = ExtResource("6_ddk56")
|
||||||
|
falling_curve = SubResource("Curve_msnum")
|
||||||
|
air_run_stats = SubResource("Resource_hmkwm")
|
||||||
|
|
||||||
|
[node name="Idle" type="Node" parent="StateMachine"]
|
||||||
|
script = ExtResource("8_ychal")
|
||||||
|
stop_curve = SubResource("Curve_0konv")
|
||||||
|
|
||||||
|
[node name="Follow" type="Node" parent="StateMachine"]
|
||||||
|
script = ExtResource("9_jk21m")
|
||||||
|
run_stats = ExtResource("5_ilrw2")
|
||||||
|
|
||||||
|
[node name="Attack" type="Node" parent="StateMachine" node_paths=PackedStringArray("anim")]
|
||||||
|
script = ExtResource("10_y7j8d")
|
||||||
|
anim = NodePath("../../AnimationPlayer")
|
||||||
|
|
||||||
|
[node name="Icon" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("11_g0hh5")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = ExtResource("12_3omr2")
|
||||||
|
|
||||||
|
[node name="ToolWalkingRange" type="Node2D" parent="."]
|
||||||
|
script = ExtResource("13_52xwv")
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
libraries = {
|
||||||
|
"": SubResource("AnimationLibrary_t2tep")
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="Skamtebord" type="Area2D" parent="."]
|
||||||
|
visible = false
|
||||||
|
rotation = 0.502655
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 4
|
||||||
|
script = ExtResource("14_fi5h3")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Skamtebord"]
|
||||||
|
position = Vector2(181.188, 11.5)
|
||||||
|
shape = SubResource("RectangleShape2D_d11af")
|
||||||
|
disabled = true
|
||||||
|
|
||||||
|
[node name="Kicks" type="Sprite2D" parent="Skamtebord"]
|
||||||
|
position = Vector2(179, 11.5)
|
||||||
|
scale = Vector2(1.85938, 0.367188)
|
||||||
|
texture = ExtResource("11_g0hh5")
|
||||||
|
|
||||||
|
[node name="HurtBox" parent="." instance=ExtResource("15_crj2h")]
|
||||||
|
|
||||||
|
[node name="Shape" type="CollisionShape2D" parent="HurtBox"]
|
||||||
|
shape = ExtResource("12_3omr2")
|
||||||
|
|
||||||
|
[node name="HitBox" type="Area2D" parent="."]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 4
|
||||||
|
script = ExtResource("14_fi5h3")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="HitBox"]
|
||||||
|
shape = ExtResource("12_3omr2")
|
||||||
|
|
||||||
|
[node name="DetectBox" type="Node2D" parent="."]
|
||||||
|
script = ExtResource("16_lcoe5")
|
||||||
|
|
||||||
|
[node name="Detect" type="Area2D" parent="DetectBox"]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 4
|
||||||
|
|
||||||
|
[node name="Shape" type="CollisionShape2D" parent="DetectBox/Detect"]
|
||||||
|
shape = SubResource("CircleShape2D_i74o8")
|
||||||
|
debug_color = Color(0.580392, 0.529412, 0.423529, 0.192157)
|
||||||
|
|
||||||
|
[node name="Undetect" type="Area2D" parent="DetectBox"]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 4
|
||||||
|
|
||||||
|
[node name="Shape" type="CollisionShape2D" parent="DetectBox/Undetect"]
|
||||||
|
shape = SubResource("CircleShape2D_pv3id")
|
||||||
|
debug_color = Color(0.556863, 0.545098, 0.364706, 0.0901961)
|
||||||
|
|
||||||
|
[node name="AttackRange" type="Node2D" parent="."]
|
||||||
|
script = ExtResource("16_lcoe5")
|
||||||
|
|
||||||
|
[node name="Detect" type="Area2D" parent="AttackRange"]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 4
|
||||||
|
|
||||||
|
[node name="Shape" type="CollisionShape2D" parent="AttackRange/Detect"]
|
||||||
|
rotation = 1.5708
|
||||||
|
shape = SubResource("CapsuleShape2D_602j6")
|
||||||
|
debug_color = Color(1, 0.00784314, 0.0352941, 0.0509804)
|
||||||
|
|
||||||
|
[node name="Undetect" type="Area2D" parent="AttackRange"]
|
||||||
|
collision_layer = 0
|
||||||
|
collision_mask = 4
|
||||||
|
|
||||||
|
[node name="Shape" type="CollisionShape2D" parent="AttackRange/Undetect"]
|
||||||
|
rotation = 1.5708
|
||||||
|
shape = SubResource("CapsuleShape2D_602j6")
|
||||||
|
debug_color = Color(1, 0.00784314, 0.0352941, 0.0509804)
|
||||||
|
|
||||||
|
[connection signal="hurt" from="HurtBox" to="Actor" method="_on_hurt_box_hurt"]
|
11
enemies/Bingus/ToolWalkingRange.gd
Normal file
11
enemies/Bingus/ToolWalkingRange.gd
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
@tool
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
@onready var actor = get_parent()
|
||||||
|
|
||||||
|
func _process(_delta):
|
||||||
|
queue_redraw()
|
||||||
|
|
||||||
|
func _draw():
|
||||||
|
if Engine.is_editor_hint():
|
||||||
|
draw_line(Vector2(-actor.walk_range/2,0), Vector2(actor.walk_range/2, 0), Color.PURPLE, 3)
|
26
enemies/Bingus/run-stats.tres
Normal file
26
enemies/Bingus/run-stats.tres
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
[gd_resource type="Resource" script_class="RunStats" load_steps=5 format=3 uid="uid://2djq1tgyepbq"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://state_machine/misc/RunStats.gd" id="1_t4kou"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_q4yvk"]
|
||||||
|
min_value = -100.0
|
||||||
|
max_value = 858.55
|
||||||
|
_data = [Vector2(0, 485.089), 0.0, 0.0, 0, 0, Vector2(0.345455, -37.7565), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 2
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_i3mgk"]
|
||||||
|
max_value = 200.0
|
||||||
|
_data = [Vector2(0.473354, 200), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 1
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_06xsq"]
|
||||||
|
max_value = 200.0
|
||||||
|
_data = [Vector2(0.435045, 200), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 1
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_t4kou")
|
||||||
|
accel_curve = SubResource("Curve_q4yvk")
|
||||||
|
turn_curve = SubResource("Curve_06xsq")
|
||||||
|
stop_curve = SubResource("Curve_i3mgk")
|
||||||
|
time = 200.0
|
4
enemies/Bingus/shape.tres
Normal file
4
enemies/Bingus/shape.tres
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[gd_resource type="RectangleShape2D" format=3 uid="uid://bjoa448gcewge"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
size = Vector2(128, 128)
|
|
@ -3353,14 +3353,14 @@ texture = ExtResource("2_vgtwj")
|
||||||
position = Vector2(817, 417)
|
position = Vector2(817, 417)
|
||||||
sprite_frames = SubResource("SpriteFrames_yel3h")
|
sprite_frames = SubResource("SpriteFrames_yel3h")
|
||||||
autoplay = "default"
|
autoplay = "default"
|
||||||
frame_progress = 0.586908
|
frame_progress = 0.164729
|
||||||
|
|
||||||
[node name="SpritesheetAnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="SpritesheetAnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
position = Vector2(1041, 417)
|
position = Vector2(1041, 417)
|
||||||
sprite_frames = SubResource("SpriteFrames_5buq8")
|
sprite_frames = SubResource("SpriteFrames_5buq8")
|
||||||
animation = &"new_animation"
|
animation = &"new_animation"
|
||||||
autoplay = "new_animation"
|
autoplay = "new_animation"
|
||||||
frame_progress = 0.71
|
frame_progress = 0.28586
|
||||||
|
|
||||||
[connection signal="area_entered" from="BossFocusZone/EnterBox" to="BossFocusZone" method="focus"]
|
[connection signal="area_entered" from="BossFocusZone/EnterBox" to="BossFocusZone" method="focus"]
|
||||||
[connection signal="area_entered" from="BossFocusZone/ExitBox" to="BossFocusZone" method="stop_focus"]
|
[connection signal="area_entered" from="BossFocusZone/ExitBox" to="BossFocusZone" method="stop_focus"]
|
||||||
|
|
Loading…
Reference in a new issue