diff --git a/godot/assets/Screen_Start.png b/godot/assets/Screen_Start.png index 1be8b57..444caf7 100644 Binary files a/godot/assets/Screen_Start.png and b/godot/assets/Screen_Start.png differ diff --git a/godot/src/base-system/RelativeRemoteTransform2D.gd b/godot/src/base-system/RelativeRemoteTransform2D.gd index f088f2d..c41bde9 100644 --- a/godot/src/base-system/RelativeRemoteTransform2D.gd +++ b/godot/src/base-system/RelativeRemoteTransform2D.gd @@ -3,6 +3,9 @@ extends Node2D @export var remote_node: Node2D @export var relative_to_origin := 1.1 +@export var center := Vector2.ZERO func _process(delta): - remote_node.global_position = global_position * relative_to_origin + if remote_node: + var dir = global_position - center + remote_node.global_position = dir * relative_to_origin diff --git a/godot/src/character/PlayerMirrorSprite2D.gd b/godot/src/character/PlayerMirrorSprite2D.gd index 2386b5f..81047c6 100644 --- a/godot/src/character/PlayerMirrorSprite2D.gd +++ b/godot/src/character/PlayerMirrorSprite2D.gd @@ -1,6 +1,7 @@ class_name PlayerMirrorSprite2D extends MirrorSprite2D +@export var clone := false @export var player: Player @export var normal_trident_texture: Texture2D @export var mirror_trident_texture: Texture2D @@ -15,3 +16,9 @@ func update(): super.update() else: texture = mirror_trident_texture if GameManager.mirror else normal_trident_texture + +func _process(_d): + if not clone: return + + frame = player.get_frame() + scale.x = player.get_body_scale().y diff --git a/godot/src/character/player_reflection.tscn b/godot/src/character/player_reflection.tscn index d480946..6a682b5 100644 --- a/godot/src/character/player_reflection.tscn +++ b/godot/src/character/player_reflection.tscn @@ -8,8 +8,10 @@ [node name="PlayerMirrorSprite2D" type="Sprite2D"] texture = ExtResource("5_h6dwk") +offset = Vector2(3, -2) hframes = 4 script = ExtResource("4_j7uc5") +clone = true normal_trident_texture = ExtResource("1_awrgi") mirror_trident_texture = ExtResource("3_4mtbe") mirror_texture = ExtResource("1_m2o5t") diff --git a/godot/src/game.gd b/godot/src/game.gd index 952bc08..8bdae25 100644 --- a/godot/src/game.gd +++ b/godot/src/game.gd @@ -6,6 +6,7 @@ const ROOM = preload("res://src/props/room.tscn") @onready var player = $Player @onready var music_player = $MusicPlayer @onready var mirror_viewport = $MirrorViewport +@onready var relative_remote_transform_2d = $Player/RelativeRemoteTransform2D @export var enemy_value := 5.0 @export var enemy_kills := 5.0 @@ -54,6 +55,8 @@ func _create_room() -> Room: _logger.debug("Player entered in direction %s" % dir) var new_room = room.rooms[dir] cam.global_position = new_room.global_position + relative_remote_transform_2d.center = cam.global_position + player.velocity = Vector2.ZERO player.global_position = new_room.get_door(-dir).global_position + dir * 10 player.immediate_return_trident() diff --git a/godot/src/game.tscn b/godot/src/game.tscn index 15f3fb2..682171c 100644 --- a/godot/src/game.tscn +++ b/godot/src/game.tscn @@ -155,9 +155,10 @@ position_smoothing_enabled = true z_index = 10 [node name="RelativeRemoteTransform2D" type="Node2D" parent="Player" node_paths=PackedStringArray("remote_node")] +position = Vector2(0, -2) script = ExtResource("3_vvprc") remote_node = NodePath("../../MirrorViewport/PlayerReflection") -relative_to_origin = 1.05 +relative_to_origin = 1.06 [node name="BGM" type="AudioStreamPlayer" parent="."] process_mode = 3 diff --git a/godot/src/player.gd b/godot/src/player.gd index fef04f5..156dc53 100644 --- a/godot/src/player.gd +++ b/godot/src/player.gd @@ -120,3 +120,8 @@ func immediate_return_trident(): trident = null _update_throw() +func get_frame(): + return sprite.frame + +func get_body_scale(): + return body.scale diff --git a/godot/src/start.tscn b/godot/src/start.tscn index cde2f49..28801dc 100644 --- a/godot/src/start.tscn +++ b/godot/src/start.tscn @@ -37,6 +37,7 @@ stretch_mode = 5 [node name="ScreenBubbles" parent="MarginContainer2" instance=ExtResource("3_8tvo4")] [node name="Background2" type="TextureRect" parent="MarginContainer2"] +modulate = Color(1, 1, 1, 0.721569) layout_mode = 2 texture = ExtResource("5_ao30t") expand_mode = 5