Added wall jumps and tweaked values and movement

This commit is contained in:
2026-02-16 23:47:10 -05:00
parent 5518f3ce79
commit c3d09c9a88
6 changed files with 64 additions and 20 deletions
+17 -5
View File
@@ -13,15 +13,19 @@ signal move
const GRAVITY: int = 700
@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 maxAirSpeed: float = 350
@export var friction: int = 3000
@export var airFriction: int = 1400
@export var jumpHight: float = -300
@export var maxJumpCount: int = 2
@export var dashSpeed: float = 600
@export var wallPushBack: float = 200
var canDash: bool = true
var deathEffect: PackedScene = preload("uid://dm4oirxl6bpnn")
var camreaCenterPosition: Vector2
var swordHitBoxXPos: float
var dashTime: float = 0.1
func _ready() -> void:
#connects the signal from scene manager to on spawn
@@ -33,11 +37,11 @@ func _ready() -> void:
func _physics_process(delta: float) -> void:
#calls move and slide so the state scripts don't have to cause that causes bugs
move_and_slide()
#print(velocity.x)
#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
get_dash()
#kills the player when they get too low
#if global_position.y > 200:
@@ -69,3 +73,11 @@ func hurt(enemy: Node2D) -> void:
if PlayerManager.currenthealth == 0:
player_death()
func get_dash() -> void:
if is_on_floor():
await get_tree().create_timer(dashTime).timeout
if is_on_floor():
canDash = true
if is_on_wall():
canDash = true