Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ---- 2E COPIER-COLLER ----
- func fire():
- var bullet_instance = bullet.instance()
- bullet_instance.position = get_global_position()
- bullet_instance.rotation_degrees = rotation_degrees
- bullet_instance.apply_impulse(Vector2(), Vector2(bullet_speed, 0).rotated(rotation))
- get_tree().get_root().call_deferred("add_child", bullet_instance)
- func kill():
- var _tmp = get_tree().reload_current_scene()
- func _on_Area2D_body_entered(body:Node):
- if "Enemy" in body.name:
- kill()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement