-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added the FluddManager class that handles the nozzle types, the available nozzles, and the active nozzle. - Added a way to switch between FLUDD nozzles. (Code only, no implementation) - Gave every PlayerState a reference to the FluddManager through a descendant line. (See PlayerStateManager)
- Loading branch information
Showing
10 changed files
with
93 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
class_name FluddManager | ||
extends Node | ||
## Handles communication between PlayerStates in regards to FLUDD. | ||
|
||
enum Nozzle{ | ||
NONE, | ||
HOVER, | ||
ROCKET, | ||
TURBO, | ||
} | ||
|
||
var available_nozzles: Array[Nozzle] = [ | ||
Nozzle.NONE, | ||
Nozzle.HOVER, | ||
#Nozzle.ROCKET, | ||
#Nozzle.TURBO, | ||
] | ||
|
||
var active_nozzle: Nozzle = Nozzle.NONE | ||
|
||
|
||
# Done within physics process to guarantee being properly synced with the player. | ||
func _physics_process(_delta: float) -> void: | ||
if Input.is_action_just_pressed(&"switch_nozzle"): | ||
switch_nozzle() | ||
|
||
|
||
func switch_nozzle() -> void: | ||
var current_id: int = available_nozzles.find(active_nozzle) | ||
|
||
active_nozzle = available_nozzles[wrapi(current_id + 1, 0, available_nozzles.size())] | ||
|
||
print(Nozzle.find_key(active_nozzle)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
entities/player/shared/states/dry/airborne/fall_states/water_exit.gd
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class_name LazyJump | ||
extends Fall | ||
## A jump that doesn't give you any height. | ||
## Used for actions that look like jumps but don't act like them. | ||
|
||
|
||
func _trans_rules() -> Variant: | ||
if not movement.dived and movement.can_air_action() and input.buffered_input(&"dive"): | ||
return &"Dive" | ||
|
||
if movement.can_spin() and input.buffered_input(&"spin"): | ||
return &"Spin" | ||
|
||
if Input.is_action_just_pressed(&"groundpound") and movement.can_air_action(): | ||
return &"GroundPound" | ||
|
||
if actor.push_rays.is_colliding() and input.buffered_input(&"jump"): | ||
return [&"Walljump", -movement.facing_direction] | ||
|
||
if movement.can_init_wallslide(): | ||
return &"Wallslide" | ||
|
||
if actor.vel.y > 0: | ||
return &"Fall" | ||
|
||
return &"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ func _trans_rules(): | |
|
||
|
||
func _defer_rules(): | ||
return &"WaterExit" | ||
return &"LazyJump" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters