Skip to content
Snippets Groups Projects
Commit 9199cd7a authored by Jannik Rosendahl's avatar Jannik Rosendahl
Browse files

fix fireball sprite mirror

parent 1e926de4
No related branches found
No related tags found
No related merge requests found
......@@ -26,3 +26,11 @@ func _on_Area2D_body_entered(body : Node):
queue_free()
#print("collided with " + str(body.name) + " - " + str(body.get_class()) + " - " + str(body.get_groups()))
func set_direction(dir: Vector2):
direction = dir
print(dir)
if dir.x < 0:
print("flip")
$Sprite.flip_v = true
$Sprite.offset.y = 25
......@@ -12,7 +12,7 @@ collision_mask = 24
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -18 )
position = Vector2( -12, -18 )
rotation = -1.57079
texture = ExtResource( 2 )
......@@ -21,7 +21,7 @@ collision_layer = 5
collision_mask = 24
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2( 12, -18 )
position = Vector2( 0, -18 )
shape = SubResource( 2 )
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
......@@ -211,7 +211,7 @@ func attack_process():
if attack_state == ATTACK_STATES.RANGED:
var b = FireBall.instance()
b.position = self.position
b.direction = self.last_look_direction
b.set_direction(self.last_look_direction)
get_tree().current_scene.add_child(b)
if attack_state == ATTACK_STATES.MELEE:
print("melee")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment