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
@@ -3,10 +3,10 @@
|
|||||||
[ext_resource type="Script" path="res://enemies/walker/walker.gd" id="1_walker"]
|
[ext_resource type="Script" path="res://enemies/walker/walker.gd" id="1_walker"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="BodyShape"]
|
[sub_resource type="RectangleShape2D" id="BodyShape"]
|
||||||
size = Vector2(42, 78)
|
size = Vector2(34, 62)
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="AttackShape"]
|
[sub_resource type="RectangleShape2D" id="AttackShape"]
|
||||||
size = Vector2(50, 60)
|
size = Vector2(40, 48)
|
||||||
|
|
||||||
[node name="Walker" type="CharacterBody2D" groups=["enemy"]]
|
[node name="Walker" type="CharacterBody2D" groups=["enemy"]]
|
||||||
collision_layer = 4
|
collision_layer = 4
|
||||||
@@ -36,10 +36,10 @@ monitorable = false
|
|||||||
shape = SubResource("AttackShape")
|
shape = SubResource("AttackShape")
|
||||||
|
|
||||||
[node name="FloorProbe" type="RayCast2D" parent="."]
|
[node name="FloorProbe" type="RayCast2D" parent="."]
|
||||||
position = Vector2(24, 34)
|
position = Vector2(19, 27)
|
||||||
target_position = Vector2(0, 34)
|
target_position = Vector2(0, 27)
|
||||||
collision_mask = 1
|
collision_mask = 1
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
||||||
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
|
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
|
||||||
rect = Rect2(-32, -48, 64, 96)
|
rect = Rect2(-26, -38, 52, 76)
|
||||||
@@ -11,5 +11,5 @@ sprite_frames = ExtResource("2_frames")
|
|||||||
max_health = 100
|
max_health = 100
|
||||||
move_speed = 400.0
|
move_speed = 400.0
|
||||||
jump_velocity = -600.0
|
jump_velocity = -600.0
|
||||||
basic_attack_damage = 1
|
basic_attack_damage = 5
|
||||||
air_attack_damage = 3
|
air_attack_damage = 10
|
||||||
@@ -11,5 +11,5 @@ sprite_frames = ExtResource("2_frames")
|
|||||||
max_health = 100
|
max_health = 100
|
||||||
move_speed = 400.0
|
move_speed = 400.0
|
||||||
jump_velocity = -600.0
|
jump_velocity = -600.0
|
||||||
basic_attack_damage = 1
|
basic_attack_damage = 5
|
||||||
air_attack_damage = 3
|
air_attack_damage = 10
|
||||||
@@ -11,5 +11,5 @@ sprite_frames = ExtResource("2_frames")
|
|||||||
max_health = 100
|
max_health = 100
|
||||||
move_speed = 400.0
|
move_speed = 400.0
|
||||||
jump_velocity = -600.0
|
jump_velocity = -600.0
|
||||||
basic_attack_damage = 1
|
basic_attack_damage = 5
|
||||||
air_attack_damage = 3
|
air_attack_damage = 10
|
||||||
@@ -11,5 +11,5 @@ sprite_frames = ExtResource("2_frames")
|
|||||||
max_health = 100
|
max_health = 100
|
||||||
move_speed = 400.0
|
move_speed = 400.0
|
||||||
jump_velocity = -600.0
|
jump_velocity = -600.0
|
||||||
basic_attack_damage = 1
|
basic_attack_damage = 5
|
||||||
air_attack_damage = 3
|
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 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
|
# DAMAGE RECEIVED
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
@@ -184,6 +196,8 @@ var ground_pound_active: bool = false
|
|||||||
var ground_pound_debug_timer: float = 0.0
|
var ground_pound_debug_timer: float = 0.0
|
||||||
var is_dead: bool = false
|
var is_dead: bool = false
|
||||||
|
|
||||||
|
var jumps_remaining: int = 2
|
||||||
|
|
||||||
# Tracks the highest point reached since leaving the ground, used to scale
|
# Tracks the highest point reached since leaving the ground, used to scale
|
||||||
# ground pound damage by jump height instead of fall distance.
|
# ground pound damage by jump height instead of fall distance.
|
||||||
var _jump_height_tracking: bool = false
|
var _jump_height_tracking: bool = false
|
||||||
@@ -206,6 +220,8 @@ func _ready() -> void:
|
|||||||
if character_data.sprite_frames != null:
|
if character_data.sprite_frames != null:
|
||||||
animated_sprite.sprite_frames = character_data.sprite_frames
|
animated_sprite.sprite_frames = character_data.sprite_frames
|
||||||
|
|
||||||
|
jumps_remaining = max_jumps
|
||||||
|
|
||||||
_setup_attack_hitboxes()
|
_setup_attack_hitboxes()
|
||||||
_update_facing()
|
_update_facing()
|
||||||
_update_animation()
|
_update_animation()
|
||||||
@@ -245,8 +261,10 @@ func _physics_process(delta: float) -> void:
|
|||||||
_jump_height_tracking = false
|
_jump_height_tracking = false
|
||||||
|
|
||||||
# Landing is only reliable after move_and_slide() has resolved collisions.
|
# Landing is only reliable after move_and_slide() has resolved collisions.
|
||||||
if ground_pound_active and not was_on_floor and is_on_floor():
|
if not was_on_floor and is_on_floor():
|
||||||
_ground_pound_impact()
|
jumps_remaining = max_jumps
|
||||||
|
if ground_pound_active:
|
||||||
|
_ground_pound_impact()
|
||||||
|
|
||||||
_update_animation()
|
_update_animation()
|
||||||
queue_redraw()
|
queue_redraw()
|
||||||
@@ -326,6 +344,7 @@ func _apply_gravity(delta: float) -> void:
|
|||||||
func _update_jump_windows(delta: float) -> void:
|
func _update_jump_windows(delta: float) -> void:
|
||||||
if is_on_floor():
|
if is_on_floor():
|
||||||
coyote_timer = coyote_time
|
coyote_timer = coyote_time
|
||||||
|
jumps_remaining = max_jumps
|
||||||
else:
|
else:
|
||||||
coyote_timer = max(coyote_timer - delta, 0.0)
|
coyote_timer = max(coyote_timer - delta, 0.0)
|
||||||
|
|
||||||
@@ -338,12 +357,17 @@ func _update_jump_windows(delta: float) -> void:
|
|||||||
func _handle_jump() -> void:
|
func _handle_jump() -> void:
|
||||||
if (
|
if (
|
||||||
jump_buffer_timer > 0.0
|
jump_buffer_timer > 0.0
|
||||||
and coyote_timer > 0.0
|
|
||||||
and not ground_pound_active
|
and not ground_pound_active
|
||||||
):
|
):
|
||||||
velocity.y = character_data.jump_velocity
|
if is_on_floor() or coyote_timer > 0.0:
|
||||||
jump_buffer_timer = 0.0
|
velocity.y = character_data.jump_velocity
|
||||||
coyote_timer = 0.0
|
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:
|
if Input.is_action_just_released("jump") and velocity.y < 0.0:
|
||||||
velocity.y *= jump_cut_multiplier
|
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"]
|
[ext_resource type="PackedScene" path="res://ui/hud/special_charge_hud.tscn" id="6_special_charge_hud"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="PlayerShape"]
|
[sub_resource type="RectangleShape2D" id="PlayerShape"]
|
||||||
size = Vector2(65, 115)
|
size = Vector2(52, 92)
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D" groups=["player"]]
|
[node name="Player" type="CharacterBody2D" groups=["player"]]
|
||||||
z_index = 1
|
z_index = 1
|
||||||
@@ -49,14 +49,14 @@ monitorable = false
|
|||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
z_index = -1
|
z_index = -1
|
||||||
scale = Vector2(0.80251265, 0.8025128)
|
scale = Vector2(0.64201, 0.64201)
|
||||||
sprite_frames = ExtResource("2_frames")
|
sprite_frames = ExtResource("2_frames")
|
||||||
animation = &"idle"
|
animation = &"idle"
|
||||||
speed_scale = 2.0
|
speed_scale = 2.0
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="."]
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
scale = Vector2(0.5, 0.5)
|
scale = Vector2(0.5, 0.5)
|
||||||
zoom = Vector2(2, 2)
|
zoom = Vector2(2.4, 2.4)
|
||||||
script = ExtResource("3_camera")
|
script = ExtResource("3_camera")
|
||||||
|
|
||||||
[node name="PlayerHealthHUD" parent="." instance=ExtResource("5_health_hud")]
|
[node name="PlayerHealthHUD" parent="." instance=ExtResource("5_health_hud")]
|
||||||
|
|||||||
Reference in new issue
Block a user