mirror of
https://github.com/GDQuest/godot-platformer-2d.git
synced 2026-07-17 16:34:54 +00:00
Fix #150: increase Air max speed based on the previous state's velocity
This commit is contained in:
parent
0a0950d829
commit
87037136d2
1 changed files with 3 additions and 1 deletions
|
|
@ -22,8 +22,10 @@ export var acceleration_x: = 5000.0
|
|||
|
||||
func enter(msg: Dictionary = {}) -> void:
|
||||
var move: = get_parent()
|
||||
move.velocity = msg.velocity if "velocity" in msg else move.velocity
|
||||
move.acceleration.x = acceleration_x
|
||||
if "velocity" in msg:
|
||||
move.velocity = msg.velocity
|
||||
move.max_speed.x = max(abs(msg.velocity.x), move.max_speed.x)
|
||||
if "impulse" in msg:
|
||||
move.velocity += calculate_jump_velocity(msg.impulse)
|
||||
if "wall_jump" in msg:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue