我从小就有个梦想,我想做游戏。虽然我大学的时候选择了计算机,工作也是计算机,但是我一直没有时间去学游戏引擎。原因有二:第一,我刚开始工作并没有那么强的代码能力。第二,我工作并不是写游戏代码。
那么为什么我要选择Godot呢?原因如下
我目前的环境是
注意,我这里默认你已经了解最简单的Godot 编辑器操作。并且完成了上面博客的功能。
这里新建两个控件,按钮控件和文本控件。



using Godot;
using System;
using System.Diagnostics;
public partial class test_node : Node2D
{
// Called when the node enters the scene tree for the first time.
private Label _lable;
private Button _button;
private int num = 0;
public override void _Ready()
{
_lable = this.GetNode<Label>("Label");
_button = this.GetNode<Button>("Button");
_lable.Text = "修改";
_button.ButtonDown += _button_ButtonDown;
}
public void _button_ButtonDown()
{
_lable.Text = $"按下修改{num}";
GD.Print($"按下修改{num}");
num++;
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
}
}

这里简单讲解了Godot的基础和简单的项目案例。我们后面大部分的功能都是基于button和lable来实现的。下一节我们将讲解最复杂的信号。