- Godot Engine Game Development Projects
- Chris Bradfield
- 351字
- 2021-06-18 18:51:33
Project setup
Create a new project and download the project assets from https://github.com/PacktPublishing/Godot-Game-Engine-Projects/releases.
As you've seen previously, Godot, by default, includes a number of input actions mapped to various keyboard inputs. For example, you used ui_left and ui_right for arrow key movement in the first project. Often, however, you need a different input from the defaults provided, or you'd like to customize the actions' names. You might also wish to add actions for mouse or gamepad inputs. You can do this in the Project Settings window.
Click on the Input Map tab and add four new input actions (left, right, up, and down) by typing the names into the Action: box and clicking Add. Then, for each new action, click the + button to add a Key action and choose the corresponding arrow key. You can also add WASD controls, if you wish:

This game will have a variety of objects on the screen. Some of them should detect collisions (the player against the walls, for example), while others should ignore one another (like the enemies versus coins). You can solve this by setting the objects' physics layer and physics layer mask properties. To make these layers easier to work with, Godot allows you to give the game's physics layers custom names.
Click on the General tab and find the Layer Names/2D Physics section. Name the first four layers as follows:

You'll see how the collision layer system works with the various objects in the game later in the project.
Next, in the Display/Window section, set the Mode to viewport and the Aspect to keep. This will enable you to resize the game window while keeping the display's proportions unchanged. Refer to the following screenshot:

Finally, in the Rendering/Quality section, set Use Pixel Snap to On. This setting is useful, especially for pixel art-styled games, as it ensures that all objects are drawn at whole-number pixel values. Note that this does not affect movement, physics, or other properties; it only applies to the rendering of objects. Refer to the following screenshot:

- Big Data Analytics with Hadoop 3
- 我的J2EE成功之路
- 工業(yè)機(jī)器人產(chǎn)品應(yīng)用實戰(zhàn)
- Java實用組件集
- Hands-On Neural Networks with Keras
- CorelDRAW X4中文版平面設(shè)計50例
- 80x86/Pentium微型計算機(jī)原理及應(yīng)用
- Splunk Operational Intelligence Cookbook
- 人工智能趣味入門:光環(huán)板程序設(shè)計
- Visual FoxPro數(shù)據(jù)庫基礎(chǔ)及應(yīng)用
- Salesforce for Beginners
- 基于企業(yè)網(wǎng)站的顧客感知服務(wù)質(zhì)量評價理論模型與實證研究
- Visual Studio 2010 (C#) Windows數(shù)據(jù)庫項目開發(fā)
- Introduction to R for Business Intelligence
- ZigBee無線通信技術(shù)應(yīng)用開發(fā)