fix vertical offset thingy in camera
This commit is contained in:
parent
7c2bb78ec2
commit
8c05357fa3
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
extends Camera2D
|
||||
|
||||
onready var player = get_tree().get_nodes_in_group("player").front()
|
||||
onready var last_sector = Game.get_sector(player.global_position)
|
||||
onready var last_sector = Game.get_sector(player.global_position + Vector2(0.0, -5.0))
|
||||
#Scroll direction
|
||||
export var scroll_h = true
|
||||
export var scroll_v = false
|
||||
|
@ -16,7 +16,7 @@ func _process(delta):
|
|||
if not is_instance_valid(player):
|
||||
player = get_tree().get_nodes_in_group("player").pop_front()
|
||||
else:
|
||||
var current_sector = Game.get_sector(player.global_position)
|
||||
var current_sector = Game.get_sector(player.global_position + Vector2(0.0, -10.0))
|
||||
if scroll_h && current_sector.x != last_sector.x:
|
||||
position.x = current_sector.x * Game.resolution.x
|
||||
if respawn_h:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue