Player Movment

implented edited hollow night movement and set up player/test_scene.
This commit is contained in:
sam committed 2026-10-02 19:46:07 -06:00
1 parent 1eccb9bc67
commit 978fb7aded
4 files changed
+109 -10

No files matched your search

+10 -10
View File
@@ -10,15 +10,15 @@ class_name PlatformerController2D
#2. Animations are very primitive. To make full use of your custom art, you may want to slightly change the code for the animations
@export_category("Necesary Child Nodes")
@export var PlayerSprite: AnimatedSprite2D
@export var PlayerCollider: CollisionShape2D
@onready var PlayerSprite = $AnimatedSprite2D
@onready var PlayerCollider = $CollisionShape2D
#INFO HORIZONTAL MOVEMENT
@export_category("L/R Movement")
##The max speed your player will move
@export_range(50, 500) var maxSpeed: float = 200.0
@export_range(50, 500) var maxSpeed: float = 500
##How fast your player will reach max speed from rest (in seconds)
@export_range(0, 4) var timeToReachMaxSpeed: float = 0.2
@export_range(0, 4) var timeToReachMaxSpeed: float = 0
##How fast your player will reach zero speed from max speed (in seconds)
@export_range(0, 4) var timeToReachZeroSpeed: float = 0.2
##If true, player will instantly move and switch directions. Overrides the "timeToReach" variables, setting them to 0.
@@ -29,15 +29,15 @@ class_name PlatformerController2D
#INFO JUMPING
@export_category("Jumping and Gravity")
##The peak height of your player's jump
@export_range(0, 20) var jumpHeight: float = 2.0
@export_range(0, 20) var jumpHeight: float = 4
##How many jumps your character can do before needing to touch the ground again. Giving more than 1 jump disables jump buffering and coyote time.
@export_range(0, 4) var jumps: int = 1
@export_range(0, 4) var jumps: int = 2
##The strength at which your character will be pulled to the ground.
@export_range(0, 100) var gravityScale: float = 20.0
@export_range(0, 100) var gravityScale: float = 30
##The fastest your player can fall
@export_range(0, 1000) var terminalVelocity: float = 500.0
@export_range(0, 1000) var terminalVelocity: float = 700
##Your player will move this amount faster when falling providing a less floaty jump curve.
@export_range(0.5, 3) var descendingGravityFactor: float = 1.3
@export_range(0.5, 3) var descendingGravityFactor: float = 2
##Enabling this toggle makes it so that when the player releases the jump key while still ascending, their vertical velocity will cut by the height cut, providing variable jump height.
@export var shortHopAkaVariableJumpHeight: bool = true
##How much the jump height is cut by.
@@ -159,7 +159,7 @@ var wasLatched
var crouching
var groundPounding
var anim
var anim = PlayerSprite
var col
var animScaleLock : Vector2