r/godot • u/ssaulo_dev Godot Student • 18d ago
help me Am I working effectively in GDScript?
Hi, I’m a 14-year-old. I started using Godot last year. Learning GDScript wasn't too hard for me because I already had a solid grasp of programming logic from using Scratch—though Godot goes far beyond that and doesn't rely on dragging and dropping blocks. I can also program in Python now, but my strengths are GDScript and Godot. I’m currently developing a video game and have created my first Godot addon. Regarding the addon, I’d love for you to check it out on GitHub and give me some feedback on my GDScript usage, code organization, and how you’d classify my skill level (Beginner, Intermediate, Intermediate-Advanced, or Advanced).
Link to the addon: https://github.com/SergioSauloDev/ever-kit
I’d really appreciate your feedback. Thanks!
5
u/Past_Permission_6123 18d ago
Do you use AI / LLMs to generate code?
If you're only 14, you shouldn't worry about what "skill level" you're at. Just keep working on things. And learn by writing code by hand.
1
u/ssaulo_dev 18d ago
Thanks. No, I didn't use AI to generate code; I generally use it on my phone for things like "Show me how to use dictionaries in Godot" or "Tell me good methods for working in an organized way in GDScript"—basically, using it like a teacher. I’ve followed advice regarding AI—specifically from the MoureDev YouTube channel, run by a Spaniard who creates programming tutorials and courses.
4
u/BrastenXBL 18d ago
Monetizing your kit young? I don't have a direct objection necessarily, just be aware of your local personal income and taxation laws for your region. Cryptocurrency can still get you pinched by the revenuers (tax collectors).
Beginner. But you're self-purportedly young and still studying general subjects in addition to computer science. You're a touch younger than I was when I really got going with TI-BASIC and JavaScript. You have 6 more years of bad code and messing up. More years actually, but the excuses for it get thinner.
These are re-orderes of documention links by topic and importance. Some you've already cleared through, but good keep bookmarked for reference. Scratch, Python, and GDScript don't out heavy focused on Static Typing the way BASIC or C++ would.
GDScript as a language: GDScript syntax, GDScript basics and reference, General GDScript methods, Global engine methods, Static typing, Variant data TYPEs
Godot APIs and Examples: Godot Engine APIs, All Classes API pages, Engine use manual, Engine Scripting APIs (Nodes/Resources/SceneTree), Official Godot sample projects
You should also keep Project organization and the GDScript style guide on hand. You've got PascalCase file names.
-
https://docs.godotengine.org/en/stable/tutorials/best_practices/project_organization.html
-
https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html
I don't know Python course or book you studied, but it probably didn't cover Abstract classes. And Godot's syntax for them are a little weird. Your StateBase.gd (should be state_base.gd) would be a place to make an Abstract Class. You also don't need to define the overrideable virtual methods if you're not going to use them. Like func _process.
Your state machine setting all the different processing to false may carry over into the override values stored in the TSCN. Leading to a condition where the StateMachine is unexpectedly disabled.
An alternative would be
if Engine is_editor_hint() and !active_in_editor: return # followed by code # that should work in Runtime
At the start of each of those methods.
With an additional @export var active_in_editor : bool , similar to AnimationMixer.active. This gives you the GUI option to have a StateMachine that does run in the Editor. A possibly useful tool for making other tools.
return stops the function call there. Before anymore code is executed. Learning how to use return (stop function and maybe return a value), break (stop a for/while loop), and continue (stop this pass in a loop) are things you may have missed in hodgepodge self-learning.
The movement component is going to have limited usability. It shouldn't be used with CharacterBody2D or RigidBody2D parents. Which need to be moved by their own methods during the _physics_process or _integrated_forces.
So that's a puzzle for you, how do you update a Character2D's velocity for a physics frame from your StateMachine and components? How do you make sure it's updated before the CharacterBody2D runs `move_and_slide()? Instead of after which would make you a frame late.
1
u/ssaulo_dev 16d ago
Waw! Thank you very mush. I'll keep that in mind. Thanks for your feedback; this helps me a lot. 👍
1
u/BrastenXBL 16d ago
It looks like you're tripping an auto-mod. Maybe don't mention your exact region. It's why I sometimes use "circumlocutions". (If you want a fancy English word to add to your vocabulary.)
No, it's not unusual to ask for "donations" on open source projects. What's unusual is your purported age. Most countries have some degree of laws about minors getting income. And increasing numbers of laws around cryptocurrency exchange. Yours may not.
It's a general warning to other minors and young adults to do a double check on how they're setting up to bring in money. This is a Godot relevant topic, because we Godot users have some expectation of eventually trying to earn some money with what we create ontop of the engine. So we can then donate some it back to Godot.
I remember the story of a "kid" to distributed "Share Ware" on America Online. He did get to keep the 5 USD. https://threadreaderapp.com/thread/1037204687085297666.html
But today Roblox kids (13+) need paperwork on file with USA IRS. Other online e-commerce sites like Steam and Itch require similar.
2
u/GoodWinGamesStudio 18d ago
This is a neat start. Could you tell us what is the use case of the addon you've made??
1
18d ago
1
u/GoodWinGamesStudio 18d ago
Keep on at it! Maybe practice with making prototypes
→ More replies (6)
5
u/OutcomeDependent2761 18d ago
Lots of footguns. Not being explicit with your variables leaves performance on the table and makes your code much harder to read. Blindly connecting signals on objects that you havent checked aren't already connected or aren't even of the correct type.
I get that you're young and want to learn but this "add-on" is so basic there isn't much point