Restructuring of Nodes and Scenes. Added WorldCamera. Added a Main Scene.
This commit is contained in:
14
Scenes/Main/main.gd
Normal file
14
Scenes/Main/main.gd
Normal file
@@ -0,0 +1,14 @@
|
||||
extends Node
|
||||
|
||||
@onready var _Map = $Map
|
||||
@onready var _Player = $Player
|
||||
@onready var _Camera = $WorldCamera
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
_Map.populate_terrain(_Camera.global_position)
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
1
Scenes/Main/main.gd.uid
Normal file
1
Scenes/Main/main.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://btdvxp8ckmeb3
|
||||
16
Scenes/Main/main.tscn
Normal file
16
Scenes/Main/main.tscn
Normal file
@@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://d05j5yuhlsxp0"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cywuuce71rmgb" path="res://Scenes/Map/map.tscn" id="1_1r6ip"]
|
||||
[ext_resource type="Script" uid="uid://btdvxp8ckmeb3" path="res://Scenes/Main/main.gd" id="1_qw60k"]
|
||||
[ext_resource type="PackedScene" uid="uid://dh8pjs2s1kud3" path="res://Scenes/Player/player.tscn" id="2_lixft"]
|
||||
|
||||
[node name="Main" type="Node"]
|
||||
script = ExtResource("1_qw60k")
|
||||
|
||||
[node name="Map" parent="." instance=ExtResource("1_1r6ip")]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_lixft")]
|
||||
|
||||
[node name="WorldCamera" type="Camera2D" parent="."]
|
||||
|
||||
[editable path="Player"]
|
||||
11
Scenes/Main/world_camera.gd
Normal file
11
Scenes/Main/world_camera.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Camera2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
1
Scenes/Main/world_camera.gd.uid
Normal file
1
Scenes/Main/world_camera.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cpp4vte6rs37q
|
||||
Reference in New Issue
Block a user