Skip to content

Commit

Permalink
fix: enchanted_beam is rebounded
Browse files Browse the repository at this point in the history
  • Loading branch information
wlywlywlywly committed Jun 30, 2024
1 parent 1298404 commit 26b2b35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/bullets/enchanted_beam.gd
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ func _on_out_screen_screen_exited():
func _on_area_entered(area):
# 防止重复伤害
if area.name == "Player":
speed = -speed
area.get_node("..").hit(10)
$CollisionShape2D.set_deferred("disabled", true)
#elif area.name == 盾
#is_bound = true
#speed = -speed
2 changes: 1 addition & 1 deletion scripts/weapons/enchanted_sword.gd
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func verticalAttack(point: Vector2, to: Vector2, tim: int):
for i in range(tim):
var even = is_even(i)
var unit = 70 * (to - point if even else point - to).normalized()
var getPos = func(i): return (point if even else to) + unit * i
var getPos = func(x): return (point if even else to) + unit * x
var num = floorf((point - to).length() / unit.length()) + 1
var unit_time = move_time / num
for j in range(num):
Expand Down

0 comments on commit 26b2b35

Please sign in to comment.