I just finished make your first 2d game from the documentation. Im ngl I didnt understand alot of the codes and I feel like I just followed the tutorial without knowing anything. I did do the tutorial from GDquest on writing GDscript. But the codes on the documentation were more complicated. Ive never code before btw. Also the signals thing didnt make any sense to me. How should I continue from here?
Try to make your own small project where you can properly understand all the things that you may have just âacceptedâ in the tutorial. You will have to research and look up many tutorials but the important thing is that you donât just follow a single big tutorial that gives you all the code you will ever need, but instead combine a lot of small concepts together.
(And I do not recommend using AI to write code. Itâs great to find bugs but as soon as you ask it to write some code itself it will tend to hallucinate and cause even more confusion)
They take some getting used to⌠Hereâs how I understand them:
A signal is just an object (class), somewhat similar to nodes. It has some member functions (theyâre called methods) like emit and connect.
You can connect signals to functions either in the editor or with that connect function.
Godot emits some signals itself, like VisibleOnScreenNotifier2D.screen_exited from the tutorial. You can emit your own signals by calling emit on them.
When a signal is emitted, it calls all the functions it is connected to
Personally, I find the best way forward when Iâm trying to learn something like this is to build something simple, and then change and fiddle with it to see what happens. âHow would I reverse the controls?â âHow would I make it move faster?â âHow would I make it print something whenever it hits the edge of the screen?â That kind of thing.
As you play around with it, add features, remove features, change stuff, youâll build up an understanding for how it all works. If you find yourself stumped, come places like here and ask questions, we can probably helpâŚ