Compare commits

..

No commits in common. "f67fdbbe3ef758881b26b970bbda52f61d54db38" and "b5d9e9268c66e5137b3aae9fbe6b2c06804a94c2" have entirely different histories.

4 changed files with 12 additions and 17 deletions

View File

@ -36,15 +36,14 @@ func _ready():
#check for unique state name
if !(states_index.has(this_state.name)):
# call setup
var dupe_state = this_state.duplicate()
dupe_state.setup()
this_state.setup()
if debug_state_machine:
print("Initializing State Node: ", s)
dupe_state.debug_state = true
if dupe_state.state_timeout != null:
add_child(dupe_state.state_timeout)
this_state.debug_state = true
if this_state.state_timeout != null:
add_child(this_state.state_timeout)
# Add to state index
states_index[dupe_state.name] = dupe_state
states_index[this_state.name] = this_state
else:
push_error("Multiple states with same name in: ")
else:

View File

@ -284,8 +284,8 @@ crouch_1={
}
jump_1={
"deadzone": 0.5,
"events": [ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null)
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":32,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
}
dash_1={

View File

@ -39,8 +39,7 @@ func get_movement_direction() -> float:
var _wants_jump :bool
func wants_jump() -> bool:
if Input.is_action_just_pressed("jump_" + str(player_number)) and stamina_component.stamina >= state_stamina_cost["jump"]:
##Bugfix: Both players jump.
#desired_movement_vector.y = UP
desired_movement_vector.y = UP
_wants_jump = true
return true
else:
@ -131,8 +130,7 @@ func flip_sprite_to_movement_direction():
parent.transform.x.x = desired_movement_vector.x
func _state_process_physics_idle():
##Bugfix
if _wants_jump:
if desired_movement_vector.y == UP:
request_state_change.call_func('jump')
if _wants_crouch == true:
@ -305,7 +303,7 @@ func _state_process_physics_move():
# flip sprite in direction
flip_sprite_to_movement_direction()
if _wants_jump:
if desired_movement_vector.y == UP:
request_state_change.call_func('jump')
if desired_movement_vector.x == 0:
@ -430,7 +428,6 @@ func _state_process_physics_crouch_move():
# print("Movement State Idle State Entered!")
func _on_state_entered_jump():
print ("how many times do I get called?")
#TODO: Make this a state variable
# I used to call it 'jump_force' like an idiot.
velocity.y = -200

View File

@ -18,6 +18,5 @@ func _ready():
selected_inventory_items.set_player_number(player_number)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if PlayerInfo.get_player_data(player_number - 1) == null:
visible = false
#func _process(delta):
# pass