mirror of
https://github.com/SEISYUNLie/Platform-Jump.git
synced 2026-10-25 18:31:10 +08:00
Initial commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
extends Area2D
|
||||
|
||||
var button = null
|
||||
var camera = null
|
||||
|
||||
func _ready():
|
||||
camera = get_tree().get_first_node_in_group("camera")
|
||||
button = get_tree().get_first_node_in_group("button")
|
||||
body_entered.connect(update_camera)
|
||||
|
||||
func update_camera(body):
|
||||
print("有物体进入摄像机区域:", body.name)
|
||||
if not body.is_in_group("player"):
|
||||
return
|
||||
print("玩家进入,开始改摄像头限制")
|
||||
camera.limit_left = 555
|
||||
camera.limit_right = 1010
|
||||
camera.limit_top = 0
|
||||
camera.limit_bottom = 270
|
||||
Reference in New Issue
Block a user