update collision layers, fix player rotation
This commit is contained in:
@@ -11,4 +11,4 @@
|
|||||||
[node name="Virus" parent="." instance=ExtResource("2_oi3di")]
|
[node name="Virus" parent="." instance=ExtResource("2_oi3di")]
|
||||||
position = Vector2(468, -3)
|
position = Vector2(468, -3)
|
||||||
|
|
||||||
[node name="Node2D" parent="." instance=ExtResource("3_oi3di")]
|
[node name="MusicMixer" parent="." instance=ExtResource("3_oi3di")]
|
||||||
|
|||||||
@@ -21,13 +21,13 @@ script = ExtResource("1_w5q55")
|
|||||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
stream = SubResource("AudioStreamInteractive_lr66j")
|
stream = SubResource("AudioStreamInteractive_lr66j")
|
||||||
|
|
||||||
[node name="BossArea" type="Area2D" parent="AudioStreamPlayer"]
|
[node name="BossArea" type="Area2D" parent="."]
|
||||||
collision_layer = 0
|
collision_layer = 16
|
||||||
collision_mask = 16
|
collision_mask = 16
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="AudioStreamPlayer/BossArea"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="BossArea"]
|
||||||
scale = Vector2(50, 50)
|
scale = Vector2(50, 50)
|
||||||
shape = SubResource("CircleShape2D_khlsn")
|
shape = SubResource("CircleShape2D_khlsn")
|
||||||
|
|
||||||
[connection signal="area_entered" from="AudioStreamPlayer/BossArea" to="." method="_on_boss_area_entered"]
|
[connection signal="area_entered" from="BossArea" to="." method="_on_boss_area_entered"]
|
||||||
[connection signal="area_exited" from="AudioStreamPlayer/BossArea" to="." method="_on_boss_area_exited"]
|
[connection signal="area_exited" from="BossArea" to="." method="_on_boss_area_exited"]
|
||||||
|
|||||||
@@ -5,14 +5,18 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _on_boss_area_entered(_body: Node2D) -> void:
|
func _on_boss_area_entered(_body: Node2D) -> void:
|
||||||
|
print_debug("Boss area entered")
|
||||||
if $AudioStreamPlayer["parameters/switch_to_clip"] == "Boss":
|
if $AudioStreamPlayer["parameters/switch_to_clip"] == "Boss":
|
||||||
|
print_debug("Already in boss music")
|
||||||
return
|
return
|
||||||
|
|
||||||
$AudioStreamPlayer["parameters/switch_to_clip"] = "-> Boss"
|
$AudioStreamPlayer["parameters/switch_to_clip"] = "-> Boss"
|
||||||
|
|
||||||
|
|
||||||
func _on_boss_area_exited(_body: Node2D) -> void:
|
func _on_boss_area_exited(_body: Node2D) -> void:
|
||||||
|
print_debug("Boss area exited")
|
||||||
if $AudioStreamPlayer["parameters/switch_to_clip"] == "Base":
|
if $AudioStreamPlayer["parameters/switch_to_clip"] == "Base":
|
||||||
|
print_debug("Already in base music")
|
||||||
return
|
return
|
||||||
|
|
||||||
$AudioStreamPlayer["parameters/switch_to_clip"] = "-> Base"
|
$AudioStreamPlayer["parameters/switch_to_clip"] = "-> Base"
|
||||||
@@ -45,8 +45,7 @@ func update_move_direction():
|
|||||||
|
|
||||||
func update_target_coords():
|
func update_target_coords():
|
||||||
target = get_viewport().get_mouse_position()
|
target = get_viewport().get_mouse_position()
|
||||||
var self_view_position = self.position - camera.position + screen_size / 2
|
sprite.look_at(get_global_mouse_position())
|
||||||
sprite.look_at(target - self_view_position)
|
|
||||||
|
|
||||||
func update_camera_position():
|
func update_camera_position():
|
||||||
if not camera:
|
if not camera:
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ animations = [{
|
|||||||
[sub_resource type="CircleShape2D" id="CircleShape2D_i3pqv"]
|
[sub_resource type="CircleShape2D" id="CircleShape2D_i3pqv"]
|
||||||
|
|
||||||
[node name="Player" type="CharacterBody2D"]
|
[node name="Player" type="CharacterBody2D"]
|
||||||
collision_layer = 5
|
collision_layer = 21
|
||||||
collision_mask = 31
|
collision_mask = 31
|
||||||
motion_mode = 1
|
motion_mode = 1
|
||||||
script = ExtResource("1_4flbx")
|
script = ExtResource("1_4flbx")
|
||||||
|
|||||||
Reference in New Issue
Block a user