1 parent
adb3d8d345
commit
e39b9eaeb7
7 files changed
+33
-13
No files matched your search
+10
-12
@@ -5,9 +5,7 @@ const DASH_SPEED = 600
|
||||
const HORIZONTAL_DASH_MULT = 1.8
|
||||
const FRICTION = 100
|
||||
const GRAVITY_MULT = 0.8
|
||||
|
||||
const JUMP_VELOCITY = -410.0
|
||||
|
||||
const DASH_LENGTH = 0.2
|
||||
|
||||
var fall_timer = 0.0
|
||||
@@ -28,7 +26,6 @@ func refresh_dash(new_dashes):
|
||||
dashes = 1
|
||||
if dashes > 0:
|
||||
$Jetpack/DashIndicator.show()
|
||||
|
||||
|
||||
func refresh_jump(new_jumps):
|
||||
if new_jumps:
|
||||
@@ -44,6 +41,7 @@ func on_teleport():
|
||||
$Camera2D.position_smoothing_enabled = true
|
||||
await get_tree().create_timer(1).timeout
|
||||
teleport_cooldown = 0
|
||||
|
||||
func spawn_ghost(position):
|
||||
var ghost = preload("res://ghost.tscn")
|
||||
ghost = ghost.instantiate()
|
||||
@@ -98,16 +96,16 @@ func _process(delta: float) -> void:
|
||||
elif direction > 0:
|
||||
$Sprite2D.flip_h = false
|
||||
$Sprite2D/HatSprite.flip_h = false
|
||||
|
||||
if Input.is_action_pressed("dash_down") and is_on_floor():
|
||||
print("Crouching")
|
||||
$Sprite2D.play("crouch")
|
||||
print("MODULATE: " + str($Parallax2D/Sprite2D.modulate))
|
||||
$Parallax2D/Sprite2D.modulate = $Parallax2D/Sprite2D.modulate - Color(
|
||||
move_toward(Color.GREEN.r,$Parallax2D/Sprite2D.modulate.r,0.001),
|
||||
move_toward(Color.GREEN.g,$Parallax2D/Sprite2D.modulate.g,0.001),
|
||||
move_toward(Color.GREEN.b,$Parallax2D/Sprite2D.modulate.b,0.001)
|
||||
)
|
||||
$Parallax2D/Sprite2D.modulate = Color.CYAN
|
||||
|
||||
for hidden_object in get_tree().get_nodes_in_group("Hidden"):
|
||||
hidden_object.show()
|
||||
|
||||
elif Input.is_action_just_pressed("dash") and dashes > 0:
|
||||
dashing = true
|
||||
dashes -= 1
|
||||
@@ -129,11 +127,11 @@ func _process(delta: float) -> void:
|
||||
velocity.x = move_toward(velocity.x, 0, FRICTION)
|
||||
$Sprite2D.play("idle")
|
||||
$Sprite2D/HatSprite.play("idle")
|
||||
$Parallax2D/Sprite2D.modulate = Color(1,1,1,1)
|
||||
$Parallax2D/Sprite2D.modulate = Color.CORAL
|
||||
|
||||
|
||||
|
||||
#print("PLAYER X POSITION: " + str(position.y))
|
||||
for hidden_object in get_tree().get_nodes_in_group("Hidden"):
|
||||
hidden_object.hide()
|
||||
|
||||
#Falling to death.
|
||||
if position.y >= death_threshold:
|
||||
print("SLASH KILL")
|
||||
|
||||
Reference in new issue
Block a user