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

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.

主站蜘蛛池模板: 黄骅市| 峨眉山市| 宜川县| 安福县| 江孜县| 昌平区| 循化| 莱阳市| 江孜县| 临江市| 临泉县| 栾川县| 宁陕县| 团风县| 颍上县| 永嘉县| 柳河县| 五河县| 葫芦岛市| 新宾| 荔波县| 观塘区| 洪江市| 旺苍县| 孟州市| 华坪县| 平原县| 霍林郭勒市| 凤山县| 昭觉县| 胶州市| 山东| 肥城市| 都兰县| 静安区| 松江区| 秦皇岛市| 岳池县| 安阳县| 泾源县| 锡林郭勒盟|