princess/réglages: réglage du grab wall
Encore perfectible et il reste un bug assez rare mais pénible.
This commit is contained in:
25
princesse.gd
25
princesse.gd
@@ -26,7 +26,7 @@ var gravity: int = ProjectSettings.get("physics/2d/default_gravity")
|
||||
@export var FALLING_SPEED = 230
|
||||
@export var JUMPING_SPEED = 220
|
||||
var DASH_SPEED = WALKING_SPEED * 2
|
||||
@export var X_SPEED_TABLE = [0, 0.1, 0.15, 0.3, 0.6, 0.9, 1]
|
||||
@export var X_SPEED_TABLE = [0, 0.1, 0.15, 0.3, 0.4, 0.7, 1]
|
||||
@export var X_SPEED_DECEL = [0, 0.1, 0.6, 1]
|
||||
@export var FALL_SPEED_TABLE = [0, 0.1, 0.15, 0.2, 0.3, 0.6, 0.9, 1]
|
||||
@export var JUMP_SPEED_TABLE = [0, 0.1, 0.2, 0.5, 0.6, 0.7, 0.8, 0.9, 1]
|
||||
@@ -383,17 +383,19 @@ func read_input() -> void:
|
||||
if ground_far_detect.is_colliding() or (is_on_floor() or get_coyote(coyote_ground)):
|
||||
need_jump=true
|
||||
else:
|
||||
need_jump=false
|
||||
# Peut-il kicker ?
|
||||
if get_coyote(coyote_grab):
|
||||
if not kicking:
|
||||
kicking=true
|
||||
kick_step = KICK_SPEED_TABLE.size()-1
|
||||
if pressing_wall_left:
|
||||
kick_direction = 1
|
||||
if grab_wall:
|
||||
if pressing_wall_left:
|
||||
kick_direction = 1
|
||||
else:
|
||||
kick_direction = -1
|
||||
else:
|
||||
kick_direction = -1
|
||||
if not coyote_grab[-1]:
|
||||
kick_direction *= -1
|
||||
kick_direction = direction
|
||||
# Dès qu'il peut et veut sauter, déclencher le saut
|
||||
if need_jump and (is_on_floor() or get_coyote(coyote_ground)):
|
||||
need_jump = false
|
||||
@@ -432,7 +434,16 @@ func read_input() -> void:
|
||||
if pressing_wall:
|
||||
if not grab_wall :
|
||||
grab_wall = (
|
||||
abs(velocity.x) > 0 and
|
||||
(
|
||||
abs(velocity.x) > 0
|
||||
or
|
||||
walking
|
||||
or
|
||||
kicking
|
||||
or
|
||||
dashing
|
||||
)
|
||||
and
|
||||
(
|
||||
(pressing_wall_left and direction == -1)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user