Compare commits
2 Commits
08668de36a
...
5c2ddb4936
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c2ddb4936 | |||
| c57b275b83 |
@@ -1071,5 +1071,13 @@ position = Vector2(119, -2686)
|
||||
script = ExtResource("4_74lek")
|
||||
_steps = 190
|
||||
_jump = false
|
||||
_walk = true
|
||||
_stop_on_landing = false
|
||||
metadata/_custom_type_script = "uid://ceyu5der8j8gq"
|
||||
|
||||
[node name="Trajectory17" type="Marker2D" parent="Trajectories"]
|
||||
position = Vector2(114, -2672)
|
||||
script = ExtResource("4_74lek")
|
||||
flip = true
|
||||
_steps = 190
|
||||
metadata/_custom_type_script = "uid://ceyu5der8j8gq"
|
||||
|
||||
@@ -75,15 +75,12 @@ static func process_movement(
|
||||
|
||||
static func process_collision(
|
||||
new_velocity: Vector2,
|
||||
hit_floor: bool,
|
||||
hit_slope: bool,
|
||||
hit_ceiling: bool,
|
||||
hit_wall: bool,
|
||||
floor_angle: float,
|
||||
wall_bounce_velocity_loss: float,
|
||||
) -> Vector2:
|
||||
if hit_floor and not hit_slope and not hit_wall and not hit_ceiling:
|
||||
new_velocity = Vector2.ZERO
|
||||
if hit_slope:
|
||||
new_velocity = (
|
||||
new_velocity.slide(Vector2.UP.rotated(floor_angle))
|
||||
@@ -289,7 +286,6 @@ func _handle_collision() -> void:
|
||||
|
||||
_velocity = process_collision(
|
||||
_velocity,
|
||||
hit_floor,
|
||||
hit_slope,
|
||||
hit_ceiling,
|
||||
hit_wall,
|
||||
|
||||
@@ -193,9 +193,14 @@ func _draw() -> void:
|
||||
Vector2(sin(charge_strength * PI * 2), -cos(charge_strength * PI * 2)) * 30
|
||||
)
|
||||
draw_line(pos, pos + charge_strength_line, _charge_color)
|
||||
draw_dashed_line(
|
||||
pos + Vector2.LEFT * _player_size.x / 2,
|
||||
pos + Vector2.RIGHT * _player_size.x / 2,
|
||||
Color.WHITE
|
||||
)
|
||||
|
||||
var velocity: Vector2
|
||||
var direction: float = -1.0 if flip else 1.0
|
||||
var direction: float = 0
|
||||
var jump_released: bool = false
|
||||
var floor_angle: float = 0
|
||||
|
||||
@@ -211,6 +216,7 @@ func _draw() -> void:
|
||||
break
|
||||
|
||||
jump_released = i == 0 and _jump
|
||||
direction = (-1.0 if flip else 1.0) if (_walk or jump_released) else 0.0
|
||||
|
||||
velocity = (
|
||||
Player
|
||||
@@ -282,7 +288,6 @@ func _draw() -> void:
|
||||
Player
|
||||
. process_collision(
|
||||
velocity,
|
||||
hit_floor,
|
||||
hit_slope,
|
||||
hit_ceiling,
|
||||
hit_wall,
|
||||
|
||||
Reference in New Issue
Block a user