Removed hardcoded "camera" name reference and manual tween node camera (#411)

Co-authored-by: StraToN <StraToN@users.noreply.github.com>
This commit is contained in:
Julian Murgia
2021-10-07 08:22:27 +02:00
committed by GitHub
parent 41902b5791
commit 00de7fcc4d
15 changed files with 22 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ func validate(arguments: Array):
# Run the command
func run(command_params: Array) -> int:
(escoria.object_manager.get_object("camera").node as ESCCamera)\
(escoria.object_manager.get_object("_camera").node as ESCCamera)\
.push(
escoria.object_manager.get_object(command_params[0]).node,
command_params[1],

View File

@@ -20,7 +20,7 @@ func configure() -> ESCCommandArgumentDescriptor:
# Run the command
func run(command_params: Array) -> int:
(escoria.object_manager.get_object("camera").node as ESCCamera)\
(escoria.object_manager.get_object("_camera").node as ESCCamera)\
.set_target(
Vector2(command_params[1], command_params[2]),
command_params[0]

View File

@@ -34,7 +34,7 @@ func validate(arguments: Array):
# Run the command
func run(command_params: Array) -> int:
(escoria.object_manager.get_object("camera").node as ESCCamera)\
(escoria.object_manager.get_object("_camera").node as ESCCamera)\
.set_target(
escoria.object_manager.get_object(command_params[1]).node,
command_params[0]

View File

@@ -21,7 +21,7 @@ func configure() -> ESCCommandArgumentDescriptor:
# Run the command
func run(command_params: Array) -> int:
(escoria.object_manager.get_object("camera").node as ESCCamera)\
(escoria.object_manager.get_object("_camera").node as ESCCamera)\
.set_camera_zoom(
command_params[0],
command_params[1]

View File

@@ -34,7 +34,7 @@ func validate(arguments: Array):
# Run the command
func run(command_params: Array) -> int:
(escoria.object_manager.get_object("camera").node as ESCCamera)\
(escoria.object_manager.get_object("_camera").node as ESCCamera)\
.set_camera_zoom(
command_params[0] / escoria.game_size.y,
command_params[1]

View File

@@ -20,7 +20,7 @@ func configure() -> ESCCommandArgumentDescriptor:
# Run the command
func run(command_params: Array) -> int:
(escoria.object_manager.get_object("camera").node as ESCCamera)\
(escoria.object_manager.get_object("_camera").node as ESCCamera)\
.shift(
command_params[0],
command_params[1],

View File

@@ -6,7 +6,8 @@ class_name ESCObjectManager
const RESERVED_OBJECTS = [
"_music",
"_sound",
"_speech"
"_speech",
"_camera"
]

View File

@@ -78,7 +78,7 @@ func _ready():
),
true
)
game.get_node("camera").set_target(player)
escoria.object_manager.get_object("_camera").node.set_target(player)
for n in get_children():
if n is ESCLocation and n.is_start_location: