Enter door left now. Not just right
This commit is contained in:
parent
8a3d5b33f4
commit
9a9eabd331
|
|
@ -171,9 +171,12 @@ func _state_process_physics_roll():
|
||||||
request_state_change.call_func('fall')
|
request_state_change.call_func('fall')
|
||||||
|
|
||||||
var level_transition_latch: bool
|
var level_transition_latch: bool
|
||||||
|
var level_enter_dir: float
|
||||||
func _on_state_change_enter_right():
|
func _on_state_change_enter_right():
|
||||||
#desired_movement_vector.x = RIGHT
|
#desired_movement_vector.x = RIGHT
|
||||||
parent.transform.x.x = RIGHT
|
## Trying to do this in actor now.
|
||||||
|
#parent.transform.x.x = RIGHT
|
||||||
|
level_enter_dir = parent.transform.x.x
|
||||||
level_transition_latch = false
|
level_transition_latch = false
|
||||||
|
|
||||||
func _state_process_physics_enter_right():
|
func _state_process_physics_enter_right():
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,11 @@ func touch_the_thing(the_thing: Interactable) -> bool:
|
||||||
if the_thing is LevelTransition:
|
if the_thing is LevelTransition:
|
||||||
if movement_state_machine.current_state.name != 'enter_right':
|
if movement_state_machine.current_state.name != 'enter_right':
|
||||||
if the_thing._transition_type == 'door_right':
|
if the_thing._transition_type == 'door_right':
|
||||||
|
# Make sure we're facing right.
|
||||||
|
transform.x.x = movement_component.RIGHT
|
||||||
|
movement_state_machine.change_to_known_state('enter_right')
|
||||||
|
elif the_thing._transition_type == 'door_left':
|
||||||
|
transform.x.x = movement_component.LEFT
|
||||||
movement_state_machine.change_to_known_state('enter_right')
|
movement_state_machine.change_to_known_state('enter_right')
|
||||||
the_thing.trigger_interaction()
|
the_thing.trigger_interaction()
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
[gd_scene load_steps=5 format=2]
|
[gd_scene load_steps=7 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://src/templates/level_templates/LevelTemplate.tscn" type="PackedScene" id=1]
|
[ext_resource path="res://src/templates/level_templates/LevelTemplate.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://assets/levels/LegacyFantasy-High_Forest/tileset.tres" type="TileSet" id=2]
|
[ext_resource path="res://assets/levels/LegacyFantasy-High_Forest/tileset.tres" type="TileSet" id=2]
|
||||||
[ext_resource path="res://lib/components/Hitbox_Component.tscn" type="PackedScene" id=3]
|
[ext_resource path="res://lib/components/Hitbox_Component.tscn" type="PackedScene" id=3]
|
||||||
|
[ext_resource path="res://src/Interactables/LevelTransition.tscn" type="PackedScene" id=4]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id=1]
|
[sub_resource type="CircleShape2D" id=1]
|
||||||
radius = 5.09902
|
radius = 5.09902
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=2]
|
||||||
|
|
||||||
[node name="CloneBox" instance=ExtResource( 1 )]
|
[node name="CloneBox" instance=ExtResource( 1 )]
|
||||||
|
|
||||||
[node name="TileMap Collision" parent="." index="1"]
|
[node name="TileMap Collision" parent="." index="1"]
|
||||||
|
|
@ -39,3 +42,16 @@ shape = SubResource( 1 )
|
||||||
|
|
||||||
[node name="EnterLeft" type="Position2D" parent="." index="5"]
|
[node name="EnterLeft" type="Position2D" parent="." index="5"]
|
||||||
position = Vector2( -13, 28 )
|
position = Vector2( -13, 28 )
|
||||||
|
|
||||||
|
[node name="LevelTransition" parent="." index="6" instance=ExtResource( 4 )]
|
||||||
|
position = Vector2( -12, 31 )
|
||||||
|
_transition_type = "door_left"
|
||||||
|
_destination_level_name = "TestBox"
|
||||||
|
_destination_position_name = "EnterRight"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="LevelTransition" index="0"]
|
||||||
|
modulate = Color( 1, 0, 1, 1 )
|
||||||
|
shape = SubResource( 2 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ _destination_position_name = "EnterLeft"
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="LevelTransition" index="0"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="LevelTransition" index="0"]
|
||||||
modulate = Color( 1, 0, 1, 1 )
|
modulate = Color( 1, 0, 1, 1 )
|
||||||
position = Vector2( 316, 121 )
|
position = Vector2( 325, 121 )
|
||||||
shape = SubResource( 2 )
|
shape = SubResource( 2 )
|
||||||
|
|
||||||
[node name="Ladder" type="Area2D" parent="." index="6"]
|
[node name="Ladder" type="Area2D" parent="." index="6"]
|
||||||
|
|
@ -74,3 +74,6 @@ color = Color( 0.45098, 0.192157, 0.192157, 1 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_lock_": true
|
"_edit_lock_": true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="EnterRight" type="Position2D" parent="." index="7"]
|
||||||
|
position = Vector2( 325, 127 )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user