summaryrefslogtreecommitdiffstats
path: root/game_camera.gd
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2025-11-14 14:20:01 +0200
committerJan Tuomi <jan@jantuomi.fi>2025-11-14 14:20:01 +0200
commit5ed6eb1c724076d3119e624951b07726a665f834 (patch)
tree83e70912645de4a9ec02e0056ec709178dcfc3a0 /game_camera.gd
parent9d71ad993ec77108874db9697256b4fef385ce16 (diff)
Fix mobile UI
Diffstat (limited to 'game_camera.gd')
-rw-r--r--game_camera.gd22
1 files changed, 2 insertions, 20 deletions
diff --git a/game_camera.gd b/game_camera.gd
index 9e6fd2b..4348ace 100644
--- a/game_camera.gd
+++ b/game_camera.gd
@@ -1,27 +1,12 @@
extends Camera2D
-@onready var parent = get_parent()
-@onready var is_parent_player = parent is Player
-
## Amount to smoothly offset the camera if the parent is a Player.
@export var offset_amt: Vector2
-var time_since_floor: float = 0.0
-var time_since_floor_max: float = 1.0
-
-# Called when the node enters the scene tree for the first time.
-func _ready() -> void:
- pass # Replace with function body.
-
-
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
- #if player.is_on_floor():
- # time_since_floor = 0
- #elif time_since_floor < time_since_floor_max:
- # time_since_floor += delta
-
- if is_parent_player:
+ var parent = get_parent()
+ if parent is Player:
var player: Player = parent
position.x = player.get_facing() * offset_amt.x
@@ -29,6 +14,3 @@ func _process(_delta: float) -> void:
position.y = offset_amt.y
else:
position.y = 0
-
- #offset.y = lerpf(0.0, look_down_on_jump_amt, ease(time_since_floor, 0.2))
- #print_debug("offset y:", offset.y)