Mrs. Sex takeover
This commit is contained in:
parent
c515495a0a
commit
13a2376262
4 changed files with 70 additions and 16 deletions
|
@ -35,6 +35,10 @@ export var double_jump_force: float = 122.0
|
|||
export var underwater = false
|
||||
## old player controls
|
||||
export var beta_gameplay = false
|
||||
## upward effect of air dash
|
||||
export var dash_ascension: float = 50.0
|
||||
## side momentum of dash
|
||||
export var dash_speed: float = 80.0
|
||||
|
||||
# velocity
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
|
@ -70,6 +74,7 @@ onready var edge_detector = $Graphics/EdgeDetector
|
|||
onready var body_shape: CollisionShape2D = $"%BodyShape"
|
||||
onready var cfox: Sprite = $"%CFox"
|
||||
onready var hitbox: Area2D = $"%Hitbox"
|
||||
onready var shoot_hitbox: Area2D = $"%ShootHitbox"
|
||||
|
||||
# OVERRIDES #
|
||||
func _ready() -> void:
|
||||
|
@ -602,3 +607,29 @@ func _on_ShieldCooldown_timeout():
|
|||
|
||||
func _on_BetaFalling_state_entered() -> void:
|
||||
velocity.x = 0.0
|
||||
|
||||
|
||||
func _on_ShootHitbox_area_entered(area: Area2D) -> void:
|
||||
if area.is_in_group("enemy_hitbox"):
|
||||
area.get_parent().die()
|
||||
state_chart.send_event("bounce")
|
||||
|
||||
|
||||
func _on_AfterDashFall_state_entered() -> void:
|
||||
animation_player.play("double_jump")
|
||||
|
||||
|
||||
func _on_AirDash_state_entered() -> void:
|
||||
velocity.x = dash_speed * sign(graphics.scale.x)
|
||||
velocity.y = -dash_ascension
|
||||
shoot_hitbox.monitoring = true
|
||||
animation_player.play("shoot_airborne")
|
||||
|
||||
|
||||
func _on_AirDash_state_exited() -> void:
|
||||
shoot_hitbox.monitoring = false
|
||||
|
||||
|
||||
func _process_airdash(delta) -> void:
|
||||
if abs(velocity.x) < 4.0:
|
||||
state_chart.send_event("grounded")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue