Skip to content

Commit

Permalink
Merge pull request #55 from nezvers/melee_nested_projectile
Browse files Browse the repository at this point in the history
fix: sword slash removed from solid collision
  • Loading branch information
nezvers authored Sep 15, 2024
2 parents 5faa326 + 32ea3dc commit 97433b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 1 addition & 5 deletions scenes/projectiles/sword_slash.tscn
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[gd_scene load_steps=19 format=3 uid="uid://c6ys2qs8aeu8n"]
[gd_scene load_steps=18 format=3 uid="uid://c6ys2qs8aeu8n"]

[ext_resource type="PackedScene" uid="uid://beifde6xst23w" path="res://scenes/projectiles/projectile.tscn" id="1_lwexf"]
[ext_resource type="Texture2D" uid="uid://b3kerfdfiley3" path="res://assets/images/shadow.png" id="2_pfam2"]
[ext_resource type="PackedScene" uid="uid://djobi3eqlcjvo" path="res://scenes/vfx/trail_particle.tscn" id="3_gx0bp"]
[ext_resource type="Texture2D" uid="uid://d155og1uw717" path="res://assets/images/vfx/slash_3_strip4.png" id="4_u6vsr"]
[ext_resource type="PackedScene" uid="uid://bmmyvowwwwyu1" path="res://scenes/vfx/explosion_0.tscn" id="5_yh6pw"]
[ext_resource type="Script" path="res://scripts/weapon_system/projectile/ProjectileSpawner.gd" id="6_whjok"]
[ext_resource type="Resource" uid="uid://d1ck1axrd4kd4" path="res://resources/ReferenceNodeResources/ysort_reference.tres" id="7_d1e47"]
[ext_resource type="Script" path="res://scripts/weapon_system/projectile/SubProjectileManager.gd" id="7_n74ie"]
Expand Down Expand Up @@ -130,9 +129,6 @@ libraries = {
}
autoplay = "slash"

[node name="ProjectileImpact" parent="." index="4"]
impact_scene = ExtResource("5_yh6pw")

[node name="ProjectileSpawner" type="Node" parent="." index="5"]
script = ExtResource("6_whjok")
initial_distance = 10.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/actor/MoverTopDown2D.gd
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func _physics_process(delta:float)->void:
if distance > 0.0:
ratio = min(acceleration / distance, 1.0)
character.velocity += (direction * ratio)
var collided:bool = character.move_and_slide()
var _collided:bool = character.move_and_slide()

## Adds an impulse to velocity, like a kickback
func add_impulse(impulse:Vector2)->void:
Expand Down
7 changes: 6 additions & 1 deletion scripts/weapon_system/projectile/HitLimit.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ extends Node
@export var hit_limit:int = 1

func _ready()->void:
if hit_limit < 1:
return
damage_source.hit.connect(on_hit)
damage_source.hit_solid.connect(projectile.prepare_exit)
damage_source.hit_solid.connect(on_hit_solid)

func on_hit_solid()->void:
projectile.prepare_exit()

func on_hit()->void:
if hit_limit < 1:
Expand Down

0 comments on commit 97433b5

Please sign in to comment.