# Hurry Curry! - a game about cooking # Copyright (C) 2025 Hurry Curry! contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # class_name Renderer extends SubViewportContainer enum Mode { ITEMS, TILES } var current_object: Node3D = null var mode: Mode func setup_object(object_name: String): if current_object: current_object.queue_free() match mode: Mode.ITEMS: current_object = ItemFactory.produce(object_name, $SubViewport/Node3D/Base) $SubViewport/Node3D/Camera3D.size = 1. Mode.TILES: var tf = TileFactory.new() current_object = tf.produce(object_name, Vector2i(0, 0), ["counter", "floor", "counter", null]) current_object.translate(Vector3(-0.5, 0.0, -0.5)) $SubViewport/Node3D/Camera3D.size = 2. $SubViewport/Node3D/Base.add_child(current_object)