Inair move forgiveness, camera zoom, jump height

This commit is contained in:
Jakob Feldmann 2022-06-25 15:31:43 +02:00
parent bf5af96d20
commit c3255b30f2
4 changed files with 13 additions and 24 deletions

View File

@ -219,8 +219,8 @@ func calculate_fall_velocity(
) )
else: else:
linear_velocity.y = max_velocity["fall"] linear_velocity.y = max_velocity["fall"]
if is_equal_approx(velocity.x, 0): if (-4 < velocity.x and velocity.x < 4) :
# TODO this is weird # TODO This is poop
linear_velocity.x += inair_velocity * direction.x linear_velocity.x += inair_velocity * direction.x
if Input.is_action_just_pressed("jump"): if Input.is_action_just_pressed("jump"):
jump_buffer_filled = true jump_buffer_filled = true
@ -247,7 +247,7 @@ func calculate_wallslide_velocity(
0, acceleration_force["walljump"].y * -1, mass, delta 0, acceleration_force["walljump"].y * -1, mass, delta
) )
# TODO this is done 3 times for different states # TODO this is done 3 times for different states
# TODO make air strafe a portionable boost instead of a one time acceleration # TODO make air strafe a portionable boost instead of a one time acceleration (or not?! whaaat?)
elif is_correct_airstrafe_input(): elif is_correct_airstrafe_input():
linear_velocity.x = PhysicsFunc.two_step_euler( linear_velocity.x = PhysicsFunc.two_step_euler(
linear_velocity.x, linear_velocity.x,

View File

@ -40,7 +40,7 @@ shape = SubResource( 1 )
[node name="BlobbyCam" type="Camera2D" parent="."] [node name="BlobbyCam" type="Camera2D" parent="."]
position = Vector2( 70, 0 ) position = Vector2( 70, 0 )
current = true current = true
zoom = Vector2( 0.666, 0.666 ) zoom = Vector2( 0.75, 0.75 )
limit_left = 0 limit_left = 0
limit_top = 0 limit_top = 0
limit_right = 0 limit_right = 0

View File

@ -20,10 +20,10 @@ var init_acceleration_force := {
# Oriented around deltas of 0.0166666...s # Oriented around deltas of 0.0166666...s
# newtonmeters is the unit # newtonmeters is the unit
var acceleration_force := { var acceleration_force := {
"walk": Vector2(2000, 56000), "walk": Vector2(2000, 74000),
"idle": Vector2(2000, 56000), "idle": Vector2(2000, 74000),
"run": Vector2(2800, 59000), "run": Vector2(2800, 74000),
"walljump": Vector2(36000, 58000), "walljump": Vector2(36000, 74000),
"air_strafe": Vector2(20000, 100) "air_strafe": Vector2(20000, 100)
} }
# Gravity as m/s^2 # Gravity as m/s^2

File diff suppressed because one or more lines are too long