Troubleshooting falling.
This commit is contained in:
parent
6b1efd27e3
commit
ae24288db3
|
|
@ -116,7 +116,7 @@ animations = [ {
|
||||||
"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ) ],
|
"frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "jump",
|
"name": "jump",
|
||||||
"speed": 10.0
|
"speed": 2.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 14 ), SubResource( 15 ), SubResource( 15 ), SubResource( 16 ), SubResource( 16 ), SubResource( 17 ), SubResource( 17 ) ],
|
"frames": [ SubResource( 13 ), SubResource( 14 ), SubResource( 14 ), SubResource( 15 ), SubResource( 15 ), SubResource( 16 ), SubResource( 16 ), SubResource( 17 ), SubResource( 17 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ func set_previous_animation( old_state: StateAnimatedActor, new_state: StateAnim
|
||||||
# Handle state change from subscribed state machine.
|
# Handle state change from subscribed state machine.
|
||||||
#From signal state_changed(old_state_name, new_state)
|
#From signal state_changed(old_state_name, new_state)
|
||||||
func _on_state_change(old_state_name:String, new_state :State):
|
func _on_state_change(old_state_name:String, new_state :State):
|
||||||
print ("got the state change signal ", new_state.name)
|
print ("1? got the state change signal ", new_state.name)
|
||||||
# set current state to new_state
|
# set current state to new_state
|
||||||
#TODO: Confirm that this is a reference to the state in the
|
#TODO: Confirm that this is a reference to the state in the
|
||||||
###### State machine
|
###### State machine
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,8 @@ func process(delta):
|
||||||
|
|
||||||
# For event based input polling (Hadouken?)
|
# For event based input polling (Hadouken?)
|
||||||
func process_input(event: InputEvent):
|
func process_input(event: InputEvent):
|
||||||
|
# Reset desired movement vector
|
||||||
|
desired_movement_vector = Vector2(0,0)
|
||||||
if has_method('_state_process_input_' + current_state.name):
|
if has_method('_state_process_input_' + current_state.name):
|
||||||
call('_state_process_input_' + current_state.name)
|
call('_state_process_input_' + current_state.name)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,11 @@ dash_1={
|
||||||
common/enable_pause_aware_picking=true
|
common/enable_pause_aware_picking=true
|
||||||
2d/default_gravity=600
|
2d/default_gravity=600
|
||||||
|
|
||||||
|
[physics]
|
||||||
|
|
||||||
|
2d/default_gravity=200
|
||||||
|
common/physics_interpolation=true
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
quality/driver/driver_name="GLES2"
|
quality/driver/driver_name="GLES2"
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,6 @@ func _ready():
|
||||||
# print("Anim Knows Idle State Entered!")
|
# print("Anim Knows Idle State Entered!")
|
||||||
|
|
||||||
func _on_state_entered_fall():
|
func _on_state_entered_fall():
|
||||||
print("Anim Knows Fall State Entered!")
|
print ("2? got the state change signal ", current_state.name)
|
||||||
frame = 2
|
frame = 2
|
||||||
stop()
|
stop()
|
||||||
|
|
|
||||||
|
|
@ -63,8 +63,8 @@ func _state_process_physics_idle():
|
||||||
request_state_change.call_func('fall')
|
request_state_change.call_func('fall')
|
||||||
|
|
||||||
func _state_process_physics_fall():
|
func _state_process_physics_fall():
|
||||||
if get_movement_direction() != 0.0:
|
if desired_movement_vector.x != 0.0:
|
||||||
parent.transform.x.x = get_movement_direction()
|
parent.transform.x.x = desired_movement_vector.x
|
||||||
|
|
||||||
if parent.is_on_floor():
|
if parent.is_on_floor():
|
||||||
#modifier.reference()
|
#modifier.reference()
|
||||||
|
|
@ -72,8 +72,8 @@ func _state_process_physics_fall():
|
||||||
request_state_change.call_func('idle')
|
request_state_change.call_func('idle')
|
||||||
|
|
||||||
func _state_process_physics_jump():
|
func _state_process_physics_jump():
|
||||||
if get_movement_direction() != 0.0:
|
if desired_movement_vector.x != 0.0:
|
||||||
parent.transform.x.x = get_movement_direction()
|
parent.transform.x.x = desired_movement_vector.x
|
||||||
if velocity.y > 0:
|
if velocity.y > 0:
|
||||||
request_state_change.call_func('fall')
|
request_state_change.call_func('fall')
|
||||||
|
|
||||||
|
|
@ -84,8 +84,8 @@ func _state_process_physics_jump():
|
||||||
|
|
||||||
func _state_process_physics_move():
|
func _state_process_physics_move():
|
||||||
# flip sprite in direction
|
# flip sprite in direction
|
||||||
if get_movement_direction() != 0.0:
|
if desired_movement_vector.x != 0.0:
|
||||||
parent.transform.x.x = get_movement_direction()
|
parent.transform.x.x = desired_movement_vector.x
|
||||||
|
|
||||||
if desired_movement_vector.x == 0:
|
if desired_movement_vector.x == 0:
|
||||||
request_state_change.call_func('idle')
|
request_state_change.call_func('idle')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user