Fixed player double jumps not working. and added a dash

This commit is contained in:
2026-02-12 06:56:01 -05:00
parent 83a4a8f374
commit 5518f3ce79
12 changed files with 129 additions and 108 deletions

View File

@@ -11,13 +11,13 @@ signal move
#State Vars
const GRAVITY: int = 700
@export var speed: float = 1000
@export var maxSpeed: float = 175
@export var friction: int = 1000
@export var speed: float = 1300
@export var maxSpeed: float = 300
@export var friction: int = 1200
@export var airFriction: int = 250
@export var jumpHight: float = -275
@export var maxJumpCount: int = 1
@export var ammo: int = 3
@export var maxJumpCount: int = 2
var canDash: bool = true
var deathEffect: PackedScene = preload("uid://dm4oirxl6bpnn")
var camreaCenterPosition: Vector2
@@ -36,9 +36,12 @@ func _physics_process(delta: float) -> void:
#emits move purly for jump state cause that is dependent on exact move and slide in the code
move.emit()
if is_on_floor():
canDash = true
#kills the player when they get too low
if global_position.y > 200:
player_death()
#if global_position.y > 200:
#player_death()
#sets the players pos to the spawn pos so the player statrs on the correct door to the level
func on_spawn(spawnPosition: Vector2):