Daño aumentado, tamaño de los personajes disminuid
This commit is contained in:
1 parent
eaa6c4e8d3
commit
6d0948022a
7 files changed
+46
-22
No files matched your search
@@ -11,5 +11,5 @@ sprite_frames = ExtResource("2_frames")
|
||||
max_health = 100
|
||||
move_speed = 400.0
|
||||
jump_velocity = -600.0
|
||||
basic_attack_damage = 1
|
||||
air_attack_damage = 3
|
||||
basic_attack_damage = 5
|
||||
air_attack_damage = 10
|
||||
@@ -11,5 +11,5 @@ sprite_frames = ExtResource("2_frames")
|
||||
max_health = 100
|
||||
move_speed = 400.0
|
||||
jump_velocity = -600.0
|
||||
basic_attack_damage = 1
|
||||
air_attack_damage = 3
|
||||
basic_attack_damage = 5
|
||||
air_attack_damage = 10
|
||||
@@ -11,5 +11,5 @@ sprite_frames = ExtResource("2_frames")
|
||||
max_health = 100
|
||||
move_speed = 400.0
|
||||
jump_velocity = -600.0
|
||||
basic_attack_damage = 1
|
||||
air_attack_damage = 3
|
||||
basic_attack_damage = 5
|
||||
air_attack_damage = 10
|
||||
@@ -11,5 +11,5 @@ sprite_frames = ExtResource("2_frames")
|
||||
max_health = 100
|
||||
move_speed = 400.0
|
||||
jump_velocity = -600.0
|
||||
basic_attack_damage = 1
|
||||
air_attack_damage = 3
|
||||
basic_attack_damage = 5
|
||||
air_attack_damage = 10
|
||||
+30
-6
@@ -69,6 +69,18 @@ const ENEMY_HURTBOX_MASK: int = 1 << 4
|
||||
@export var max_fall_speed: float = 1200.0
|
||||
|
||||
|
||||
@export_category("Double Jump")
|
||||
|
||||
## Enables a second jump while in the air.
|
||||
@export var enable_double_jump: bool = true
|
||||
|
||||
## Maximum number of jumps allowed (1 = only ground/coyote, 2 = double jump).
|
||||
@export_range(1, 2, 1) var max_jumps: int = 2
|
||||
|
||||
## Height multiplier applied to the second jump relative to the character's jump force.
|
||||
@export_range(0.5, 0.95, 0.01) var double_jump_multiplier: float = 0.8
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# DAMAGE RECEIVED
|
||||
# ============================================================================
|
||||
@@ -184,6 +196,8 @@ var ground_pound_active: bool = false
|
||||
var ground_pound_debug_timer: float = 0.0
|
||||
var is_dead: bool = false
|
||||
|
||||
var jumps_remaining: int = 2
|
||||
|
||||
# Tracks the highest point reached since leaving the ground, used to scale
|
||||
# ground pound damage by jump height instead of fall distance.
|
||||
var _jump_height_tracking: bool = false
|
||||
@@ -206,6 +220,8 @@ func _ready() -> void:
|
||||
if character_data.sprite_frames != null:
|
||||
animated_sprite.sprite_frames = character_data.sprite_frames
|
||||
|
||||
jumps_remaining = max_jumps
|
||||
|
||||
_setup_attack_hitboxes()
|
||||
_update_facing()
|
||||
_update_animation()
|
||||
@@ -245,8 +261,10 @@ func _physics_process(delta: float) -> void:
|
||||
_jump_height_tracking = false
|
||||
|
||||
# Landing is only reliable after move_and_slide() has resolved collisions.
|
||||
if ground_pound_active and not was_on_floor and is_on_floor():
|
||||
_ground_pound_impact()
|
||||
if not was_on_floor and is_on_floor():
|
||||
jumps_remaining = max_jumps
|
||||
if ground_pound_active:
|
||||
_ground_pound_impact()
|
||||
|
||||
_update_animation()
|
||||
queue_redraw()
|
||||
@@ -326,6 +344,7 @@ func _apply_gravity(delta: float) -> void:
|
||||
func _update_jump_windows(delta: float) -> void:
|
||||
if is_on_floor():
|
||||
coyote_timer = coyote_time
|
||||
jumps_remaining = max_jumps
|
||||
else:
|
||||
coyote_timer = max(coyote_timer - delta, 0.0)
|
||||
|
||||
@@ -338,12 +357,17 @@ func _update_jump_windows(delta: float) -> void:
|
||||
func _handle_jump() -> void:
|
||||
if (
|
||||
jump_buffer_timer > 0.0
|
||||
and coyote_timer > 0.0
|
||||
and not ground_pound_active
|
||||
):
|
||||
velocity.y = character_data.jump_velocity
|
||||
jump_buffer_timer = 0.0
|
||||
coyote_timer = 0.0
|
||||
if is_on_floor() or coyote_timer > 0.0:
|
||||
velocity.y = character_data.jump_velocity
|
||||
jump_buffer_timer = 0.0
|
||||
coyote_timer = 0.0
|
||||
jumps_remaining = max(0, max_jumps - 1)
|
||||
elif enable_double_jump and jumps_remaining > 0:
|
||||
velocity.y = character_data.jump_velocity * double_jump_multiplier
|
||||
jump_buffer_timer = 0.0
|
||||
jumps_remaining -= 1
|
||||
|
||||
if Input.is_action_just_released("jump") and velocity.y < 0.0:
|
||||
velocity.y *= jump_cut_multiplier
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@
|
||||
[ext_resource type="PackedScene" path="res://ui/hud/special_charge_hud.tscn" id="6_special_charge_hud"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="PlayerShape"]
|
||||
size = Vector2(65, 115)
|
||||
size = Vector2(52, 92)
|
||||
|
||||
[node name="Player" type="CharacterBody2D" groups=["player"]]
|
||||
z_index = 1
|
||||
@@ -49,14 +49,14 @@ monitorable = false
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
z_index = -1
|
||||
scale = Vector2(0.80251265, 0.8025128)
|
||||
scale = Vector2(0.64201, 0.64201)
|
||||
sprite_frames = ExtResource("2_frames")
|
||||
animation = &"idle"
|
||||
speed_scale = 2.0
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
scale = Vector2(0.5, 0.5)
|
||||
zoom = Vector2(2, 2)
|
||||
zoom = Vector2(2.4, 2.4)
|
||||
script = ExtResource("3_camera")
|
||||
|
||||
[node name="PlayerHealthHUD" parent="." instance=ExtResource("5_health_hud")]
|
||||
|
||||
Reference in new issue
Block a user