Post #20: The Default 2d GDScript Script
If you create a 2d node in Godot, and add a script to it, this is the default script you'll see:

Let's break this down a bit, as a way to learn more about GDScript and Godot itself.
- The first line in this script shows us that this class inherits from the
Node2Dclass. Our class is a child class of theNode2Dclass. This is the object oriented principle of Inheritance.- Important to know: by default, in GDScript, all script files are unnamed classes
- Line 3 (and line 7) are comments. These are not executed, they are ignored, for note purposes.
- Line 4 is the start of the
_readyfunction declaration. As the comment above it says, this function is called when the node enters the scene for the first time - Line 5 has the
passkeyword, which is really mostly just a placeholder for unimplemented functions, like this. The rest of line 5 has a comment. - Line 8 is the start of the
_processfunction, which is called every frame.delta, as the comment mentions, is the elapsed time since the last frame. - Line 9 also has the
passkeyword
If you've been worried about the complications around programming things by hand, don't be! Give it a try, it's probably not as hard as you think 💪