forked from andreyratz/block
Fixed projectile rotation
Fixed minor visual glitch where projectiles wouldn't be at the correct rotation after being deflected
This commit is contained in:
@@ -23,7 +23,7 @@ func _draw():
|
|||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
position += direction * speed * delta
|
position += direction * speed * delta
|
||||||
#position += playerDirection * speed * delta
|
#position += playerDirection * speed * delta
|
||||||
look_at(player.global_position)
|
#look_at(player.global_position)
|
||||||
|
|
||||||
#look_at(direction)#
|
#look_at(direction)#
|
||||||
|
|
||||||
@@ -41,9 +41,9 @@ func changeDirection(normal: Vector2):
|
|||||||
direction = normal
|
direction = normal
|
||||||
#direction = newDirection
|
#direction = newDirection
|
||||||
#direction = direction.bounce(perp_line)
|
#direction = direction.bounce(perp_line)
|
||||||
rotation = rad_to_deg(direction.angle())
|
rotation = direction.angle()
|
||||||
print("direction:", direction)
|
print("direction:", direction)
|
||||||
|
|
||||||
func bounce(normal: Vector2):
|
func bounce(normal: Vector2):
|
||||||
direction = direction.bounce(normal)
|
direction = direction.bounce(normal)
|
||||||
rotation = rad_to_deg(direction.angle())
|
rotation = direction.angle()
|
||||||
|
|||||||
Reference in New Issue
Block a user