diff --git a/src/Actors/BlobbyCam.gd b/src/Actors/BlobbyCam.gd index f2d5e5e..a7953c5 100644 --- a/src/Actors/BlobbyCam.gd +++ b/src/Actors/BlobbyCam.gd @@ -55,11 +55,11 @@ func _ready(): func _on_SignalManager_terminal_activated(): get_node("LightAnimationPlayer").play("Pulsing") -func _draw(): - draw_line(Vector2((limit_left - position.x), screen_center.y), screen_left, Color(255, 0, 0), 1) +#func _draw(): +# draw_line(Vector2((limit_left - position.x), screen_center.y), screen_left, Color(255, 0, 0), 1) func _process(delta: float) -> void: - update() +# update() screen_center = (get_camera_screen_center() - position) screen_bottom = screen_center + Vector2(0, screen_rect.y/2) screen_top = screen_center - Vector2(0, screen_rect.y/2) @@ -91,7 +91,7 @@ func _process(delta: float) -> void: right_move_time = max(0, right_move_time - delta) _adapt_to_movement(player_vel) - if camera_state == "centered": + if abs(player_vel.x) <= blobby.max_velocity["walk"] * 0.9: _adapt_to_input(player_vel) position = blobby.position prev_pos = position @@ -105,8 +105,9 @@ func _set_boundaries(): # New pngs -> completely new tiles and rebuild map var rect = tilemap.get_used_rect() var cell_size = tilemap.cell_size - limit_right = rect.end.x * cell_size.x - limit_left = rect.position.x * cell_size.x + # TODO +2 is fixed for camera issue in adjust horizontal + limit_right = rect.end.x * cell_size.x - 8 + limit_left = rect.position.x * cell_size.x + 8 limit_top = rect.position.y * cell_size.y limit_bottom = rect.end.y * cell_size.y original_limit_left = limit_left @@ -174,17 +175,17 @@ func _adapt_to_input(velocity: Vector2) -> void: if(original_limit_top - position.y + 2 < screen_top.y && offset.y > -48): offset.y -= 1 +# TODO This is a regulatory problem, it doesn't adapt fast enough +# TODO Maybe just make background black and dont bother func _adjust_horizontal_offset(delta: float) -> void: - if (limit_left - position.x - screen_left.x > 0.00001): - print(limit_left - position.x - screen_left.x) + if (limit_left - position.x - screen_left.x > 0.001): if (anim_player.is_playing()): anim_player.stop(false) - offset.x += (limit_left - position.x - screen_left.x)/3 - if (limit_right - position.x - screen_right.x < 0.00001): - print(limit_right - position.x - screen_right.x) + offset.x += (limit_left - position.x - screen_left.x)/2 + if (limit_right - position.x - screen_right.x < 0.001): if (anim_player.is_playing()): anim_player.stop(false) - offset.x += (limit_right - position.x - screen_right.x)/3 + offset.x += (limit_right - position.x - screen_right.x)/2 func reset_limits() -> void: limit_left = original_limit_left diff --git a/src/Actors/BlobbyCam.tscn b/src/Actors/BlobbyCam.tscn index 959d642..e560fb9 100644 --- a/src/Actors/BlobbyCam.tscn +++ b/src/Actors/BlobbyCam.tscn @@ -978,10 +978,10 @@ texture = ExtResource( 8 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"] visible = false frames = SubResource( 7 ) -frame = 13 +frame = 8 playing = true [node name="AnimatedSprite2" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"] frames = SubResource( 8 ) -frame = 4 +frame = 13 playing = true diff --git a/src/Levels/Level 2.tscn b/src/Levels/Level 2.tscn index b248e96..59d037d 100644 --- a/src/Levels/Level 2.tscn +++ b/src/Levels/Level 2.tscn @@ -44,10 +44,10 @@ unique_name_in_owner = true drag_margin_bottom = 0.3 [node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"] -frame = 3 +frame = 4 [node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"] -frame = 3 +frame = 4 [node name="Blobby" parent="." instance=ExtResource( 9 )] unique_name_in_owner = true