It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
21
Camera/MainCamera.gd
Normal file
21
Camera/MainCamera.gd
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
extends Camera2D
|
||||
|
||||
var limitsSet = false
|
||||
|
||||
func _ready():
|
||||
LocationManager.location_changed.connect(set_camera_limits)
|
||||
|
||||
func _process(delta):
|
||||
global_position = GameVariables.player.global_position
|
||||
|
||||
if !limitsSet:
|
||||
set_camera_limits()
|
||||
|
||||
func set_camera_limits():
|
||||
limitsSet = true
|
||||
|
||||
var currentLocation = LocationManager.currentLocation
|
||||
limit_left = currentLocation.leftCameraLimit
|
||||
limit_right = currentLocation.rightCameraLimit
|
||||
limit_top = currentLocation.upperCameraLimit
|
||||
limit_bottom = currentLocation.lowerCameraLimit
|
||||
Loading…
Add table
Add a link
Reference in a new issue