Compare commits
No commits in common. "6bd4d302e07b10b9f357a8417da253f893665f31" and "dfdc2d059f216133db837c3f931812c3a43a914b" have entirely different histories.
6bd4d302e0
...
dfdc2d059f
|
|
@ -717,11 +717,6 @@ animations = [ {
|
||||||
"name": "ledge-climb",
|
"name": "ledge-climb",
|
||||||
"speed": 9.0
|
"speed": 9.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 50 ), SubResource( 51 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "ledge-grab",
|
|
||||||
"speed": 2.0
|
|
||||||
}, {
|
|
||||||
"frames": [ SubResource( 73 ), SubResource( 74 ), SubResource( 75 ), SubResource( 76 ), SubResource( 77 ), SubResource( 78 ) ],
|
"frames": [ SubResource( 73 ), SubResource( 74 ), SubResource( 75 ), SubResource( 76 ), SubResource( 77 ), SubResource( 78 ) ],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "pull",
|
"name": "pull",
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ func move_actor_as_desired( x_move_direction_override: float = 0):
|
||||||
var sim_move_speed = (MIN_SPEED + (sign(_move_speed_modifier) * -1 * momentum.x))
|
var sim_move_speed = (MIN_SPEED + (sign(_move_speed_modifier) * -1 * momentum.x))
|
||||||
|
|
||||||
# if move_component.momentum.x != 0:
|
# if move_component.momentum.x != 0:
|
||||||
if debug_component == true:
|
if true:
|
||||||
UiManager.debug_text = ( "Mod(" + str(sign(_move_speed_modifier)) + ") Dir(" + str(move_direction) + ") Vel(" + str(sign(current_x_velocity)) + ") Mov(" + str(sign(desired_movement_vector.x)) +
|
UiManager.debug_text = ( "Mod(" + str(sign(_move_speed_modifier)) + ") Dir(" + str(move_direction) + ") Vel(" + str(sign(current_x_velocity)) + ") Mov(" + str(sign(desired_movement_vector.x)) +
|
||||||
")\nNS:" + str(round(sim_move_speed)) + #" Z:" + str(sign(_move_speed_modifier) * -1 * move_component.momentum.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(momentum.x)) +
|
"\nS:" + str(round(_move_speed + _move_speed_modifier)) + ",M" + str(round(momentum.x)) +
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,6 @@ func _on_state_change_fall():
|
||||||
change_animation(2)
|
change_animation(2)
|
||||||
stop()
|
stop()
|
||||||
|
|
||||||
#func _on_state_change_ledge_grab():
|
|
||||||
# change_animation(1)
|
|
||||||
# stop()
|
|
||||||
|
|
||||||
func _on_state_exited_attack_sword():
|
func _on_state_exited_attack_sword():
|
||||||
print("you just swung your sword, you should get a modifier.")
|
print("you just swung your sword, you should get a modifier.")
|
||||||
#attack_sword.timeout.start()
|
#attack_sword.timeout.start()
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,6 @@ func _state_process_physics_roll():
|
||||||
|
|
||||||
|
|
||||||
func _state_process_physics_land():
|
func _state_process_physics_land():
|
||||||
$"../LedgeDetector".set_enabled(true)
|
|
||||||
if current_state.animation_finished == true:
|
if current_state.animation_finished == true:
|
||||||
request_state_change.call_func('idle')
|
request_state_change.call_func('idle')
|
||||||
|
|
||||||
|
|
@ -190,11 +189,6 @@ func _state_process_physics_hurt():
|
||||||
func _state_process_physics_fall():
|
func _state_process_physics_fall():
|
||||||
flip_sprite_to_movement_direction()
|
flip_sprite_to_movement_direction()
|
||||||
|
|
||||||
if $"../LedgeDetector".is_colliding() and !$"../WallDetector".is_colliding():
|
|
||||||
#print("it touched me!")
|
|
||||||
UiManager.debug_text = (str($"../LedgeDetector".get_collision_point()))
|
|
||||||
request_state_change.call_func('ledge_grab')
|
|
||||||
|
|
||||||
if parent.is_on_floor():
|
if parent.is_on_floor():
|
||||||
#modifier.reference()
|
#modifier.reference()
|
||||||
#idle_state.modifier = landing_modifier
|
#idle_state.modifier = landing_modifier
|
||||||
|
|
@ -203,17 +197,16 @@ func _state_process_physics_fall():
|
||||||
move_actor_as_desired()
|
move_actor_as_desired()
|
||||||
|
|
||||||
func _state_process_physics_jump():
|
func _state_process_physics_jump():
|
||||||
#UiManager.debug_text = (str(velocity))
|
if desired_movement_vector.x != 0.0:
|
||||||
|
parent.transform.x.x = desired_movement_vector.x
|
||||||
flip_sprite_to_movement_direction()
|
|
||||||
|
|
||||||
#Apparently we're instantly landing
|
|
||||||
# if parent.is_on_floor():
|
|
||||||
# #modifier.reference()
|
|
||||||
# #idle_state.modifier = landing_modifier
|
|
||||||
# request_state_change.call_func('idle')
|
|
||||||
if velocity.y > 0:
|
if velocity.y > 0:
|
||||||
request_state_change.call_func('fall')
|
request_state_change.call_func('fall')
|
||||||
|
|
||||||
|
if parent.is_on_floor():
|
||||||
|
#modifier.reference()
|
||||||
|
#idle_state.modifier = landing_modifier
|
||||||
|
request_state_change.call_func('idle')
|
||||||
|
|
||||||
move_actor_as_desired()
|
move_actor_as_desired()
|
||||||
|
|
||||||
func _state_process_physics_move():
|
func _state_process_physics_move():
|
||||||
|
|
@ -231,42 +224,6 @@ func _state_process_physics_move():
|
||||||
|
|
||||||
move_actor_as_desired()
|
move_actor_as_desired()
|
||||||
|
|
||||||
func _state_process_physics_ledge_grab():
|
|
||||||
UiManager.debug_text = (str(velocity))
|
|
||||||
$"../LedgeDetector".set_enabled(false)
|
|
||||||
|
|
||||||
if _wants_jump:
|
|
||||||
request_state_change.call_func('ledge_climb')
|
|
||||||
|
|
||||||
if _wants_crouch:
|
|
||||||
request_state_change.call_func('fall')
|
|
||||||
|
|
||||||
func _state_process_physics_ledge_climb():
|
|
||||||
# UiManager.debug_text = (str(velocity))
|
|
||||||
# $"../LedgeDetector".set_enabled(false)
|
|
||||||
|
|
||||||
UiManager.debug_text = (str(parent.is_on_floor()) +
|
|
||||||
str(parent.is_on_wall()) + ")\nV:" + str(velocity))
|
|
||||||
|
|
||||||
if current_state.animation_finished == true:
|
|
||||||
request_state_change.call_func('land')
|
|
||||||
return
|
|
||||||
|
|
||||||
if parent.is_on_wall() == true:
|
|
||||||
#velocity = parent.move_and_slide(Vector2(10.0,-60.0),Vector2.UP)
|
|
||||||
parent.move_and_slide(Vector2(10.0,-100.0),Vector2.UP)
|
|
||||||
else: #parent.is_on_floor() == true:
|
|
||||||
#velocity = parent.move_and_slide(Vector2(10.0,10.0),Vector2.UP)
|
|
||||||
parent.move_and_slide(Vector2(60.0,10.0),Vector2.UP)
|
|
||||||
|
|
||||||
#velocity = parent.move_and_slide(Vector2(60.0,-60.0),Vector2.UP)
|
|
||||||
# if parent.is_on_wall() != true:
|
|
||||||
# #modifier.reference()
|
|
||||||
# #idle_state.modifier = landing_modifier
|
|
||||||
# request_state_change.call_func('land')
|
|
||||||
# return
|
|
||||||
|
|
||||||
|
|
||||||
func _state_process_physics_crouch():
|
func _state_process_physics_crouch():
|
||||||
# flip sprite in direction
|
# flip sprite in direction
|
||||||
flip_sprite_to_movement_direction()
|
flip_sprite_to_movement_direction()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=24 format=2]
|
[gd_scene load_steps=22 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://lib/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://lib/templates/Actor/ActorTemplate.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://assets/actors/players/playerE/PlayerE_SpriteFrames.tres" type="SpriteFrames" id=2]
|
[ext_resource path="res://assets/actors/players/playerE/PlayerE_SpriteFrames.tres" type="SpriteFrames" id=2]
|
||||||
|
|
@ -18,8 +18,6 @@
|
||||||
[ext_resource path="res://lib/components/Hurtbox_Component.tscn" type="PackedScene" id=16]
|
[ext_resource path="res://lib/components/Hurtbox_Component.tscn" type="PackedScene" id=16]
|
||||||
[ext_resource path="res://lib/components/Health_Component.tscn" type="PackedScene" id=17]
|
[ext_resource path="res://lib/components/Health_Component.tscn" type="PackedScene" id=17]
|
||||||
[ext_resource path="res://lib/classes/state_animated_actor.gd" type="Script" id=18]
|
[ext_resource path="res://lib/classes/state_animated_actor.gd" type="Script" id=18]
|
||||||
[ext_resource path="res://src/actors/players/playerE/states/ledge_grab.tres" type="Resource" id=19]
|
|
||||||
[ext_resource path="res://src/actors/players/playerE/states/ledge_climb.tres" type="Resource" id=20]
|
|
||||||
|
|
||||||
[sub_resource type="Resource" id=3]
|
[sub_resource type="Resource" id=3]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
|
|
@ -46,13 +44,11 @@ script = ExtResource( 3 )
|
||||||
actor_type = "Player"
|
actor_type = "Player"
|
||||||
|
|
||||||
[node name="Movement_StateMachine" parent="." index="0"]
|
[node name="Movement_StateMachine" parent="." index="0"]
|
||||||
debug_state_machine = true
|
|
||||||
starting_state_name = "idle"
|
starting_state_name = "idle"
|
||||||
states = [ ExtResource( 4 ), ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 12 ), ExtResource( 11 ), ExtResource( 10 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), SubResource( 3 ), ExtResource( 19 ), ExtResource( 20 ) ]
|
states = [ ExtResource( 4 ), ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 12 ), ExtResource( 11 ), ExtResource( 10 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), SubResource( 3 ) ]
|
||||||
|
|
||||||
[node name="AnimatedSprite_StateReceiver" parent="." index="1"]
|
[node name="AnimatedSprite_StateReceiver" parent="." index="1"]
|
||||||
frames = ExtResource( 2 )
|
frames = ExtResource( 2 )
|
||||||
animation = "ledge-grab"
|
|
||||||
script = ExtResource( 5 )
|
script = ExtResource( 5 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_aseprite_wizard_config_": {
|
"_aseprite_wizard_config_": {
|
||||||
|
|
@ -71,26 +67,14 @@ __meta__ = {
|
||||||
[node name="Movement_StateReceiver" parent="." index="2"]
|
[node name="Movement_StateReceiver" parent="." index="2"]
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
|
|
||||||
[node name="LedgeDetector" type="RayCast2D" parent="." index="3"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="4"]
|
||||||
modulate = Color( 0, 1, 0, 1 )
|
|
||||||
position = Vector2( 8, 5 )
|
|
||||||
enabled = true
|
|
||||||
cast_to = Vector2( 1.36422e-12, 1 )
|
|
||||||
|
|
||||||
[node name="WallDetector" type="RayCast2D" parent="." index="4"]
|
|
||||||
modulate = Color( 0, 1, 0, 1 )
|
|
||||||
position = Vector2( 6, 10 )
|
|
||||||
enabled = true
|
|
||||||
cast_to = Vector2( 4, -4 )
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="6"]
|
|
||||||
position = Vector2( 0, 2 )
|
position = Vector2( 0, 2 )
|
||||||
shape = SubResource( 1 )
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="Health_Component" parent="." index="7" instance=ExtResource( 17 )]
|
[node name="Health_Component" parent="." index="5" instance=ExtResource( 17 )]
|
||||||
max_health = 100
|
max_health = 100
|
||||||
|
|
||||||
[node name="Hurtbox_Component" parent="." index="8" instance=ExtResource( 16 )]
|
[node name="Hurtbox_Component" parent="." index="6" instance=ExtResource( 16 )]
|
||||||
collision_layer = 16
|
collision_layer = 16
|
||||||
collision_mask = 128
|
collision_mask = 128
|
||||||
hurtbox_entered_function = "hit_Receiver"
|
hurtbox_entered_function = "hit_Receiver"
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
[gd_resource type="Resource" load_steps=2 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://lib/classes/state_animated_actor.gd" type="Script" id=1]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
resource_name = "ledge_climb"
|
|
||||||
script = ExtResource( 1 )
|
|
||||||
debug_state = false
|
|
||||||
timeout_seconds = 0.0
|
|
||||||
name = "ledge_climb"
|
|
||||||
horizontal_speed = 1.36422e-12
|
|
||||||
horizontal_acceleration = 0.0
|
|
||||||
horizontal_speed_offset = 0.0
|
|
||||||
horizontal_speed_offset_acceleration = 0.0
|
|
||||||
jerk_factor = 0.0
|
|
||||||
animation_sequence = [ "ledge-climb" ]
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
[gd_resource type="Resource" load_steps=2 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://lib/classes/state_animated_actor.gd" type="Script" id=1]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
resource_name = "ledge_grab"
|
|
||||||
script = ExtResource( 1 )
|
|
||||||
debug_state = false
|
|
||||||
timeout_seconds = 0.0
|
|
||||||
name = "ledge_grab"
|
|
||||||
horizontal_speed = 1.36422e-12
|
|
||||||
horizontal_acceleration = 0.0
|
|
||||||
horizontal_speed_offset = 0.0
|
|
||||||
horizontal_speed_offset_acceleration = 0.0
|
|
||||||
jerk_factor = 0.0
|
|
||||||
animation_sequence = [ "ledge-grab" ]
|
|
||||||
Loading…
Reference in New Issue
Block a user