官术网_书友最值得收藏!

About nodes and scenes

Nodes are the basic building blocks for creating games in Godot. A node is an object that can represent a variety of specialized game functions. A given type of node might display graphics, play an animation, or represent a 3D model of an object. The node also contains a collection of properties, allowing you to customize its behavior. Which nodes you add to your project depends on what functionality you need. It's a modular system designed to give you flexibility in building your game objects.

In your project, the nodes you add are organized into a tree structure. In a tree, nodes are added as children of other nodes. A particular node can have any number of children, but only one parent node. When a group of nodes are collected into a tree, it is called a scene, and the tree is referred to as the scene tree:

Scenes in Godot are typically used to create and organize the various game objects in your project. You might have a player scene that contains all the nodes and scripts that make the player's character work. Then, you might create another scene that defines the game's map: the obstacles and items that the player must navigate through. You can then combine these various scenes into the final game using instancing, which you'll learn about later.

While nodes come with a variety of properties and functions, any node's behavior and capabilities can also be extended by attaching a script to the node. This allows you to write code that makes the node do more than it can in its default state. For example, you can add a Sprite node to your scene to display an image, but if you want that image to move or disappear when clicked, you'll need to add a script to create that behavior.

主站蜘蛛池模板: 德江县| 贡山| 石阡县| 普兰县| 茶陵县| 连南| 阳西县| 于田县| 赣榆县| 内丘县| 绥滨县| 泊头市| 和平区| 大方县| 环江| 清原| 临沭县| 淳化县| 大渡口区| 扎鲁特旗| 永定县| 巴楚县| 萨迦县| 新和县| 定西市| 江城| 英超| 河间市| 西盟| 禹州市| 轮台县| 宁远县| 晋城| 靖州| 远安县| 岐山县| 枣庄市| 平谷区| 康马县| 古田县| 永丰县|