In this post we are going to take a look at How to write Parameterized Function in GDScript using Godot Engine.
In previous tutorial I posted about how to make use of the conditional logic in the Godot Engine GDScript. Like python, it was easy to implement and also something I'd recommend you to check out if you want to code the conditional logic the next time you decide to write the gdscript.
I skipped the normal function tutorial. Which I may cover in near future but as of now let's take a look at how we can create the parameterized function and how we can get it to work. So it's better to see how the function can be used in various ways in the game.
This is the 9th tutorial in the series, I have created the table of contents for the previous set of the tutorials. So you may want to check it out. also do take a look at the some of the other videos in the list. I am sure you would find it useful for learning some new and old concepts.
So let's get started with below video and you can check the TOC below if you want to access the previous tutorials.
Table of Contents of Godot Engine Tutorials
- Godot Engine - Create New Project
- Godot Engine - Change Scene Background
- Godot Engine - Add Image Background
- Godot Engine - Change Icon of Boot Splash Screen
- Godot Engine - Create GDScript
- Godot Engine - Create Function
- Godot Engine - Create Dictionary
- Godot Engine -if-else statement
Now check out the Video tutorial below in order to Create Parameterized Function in GDScript for your game project.
This video above shows you how you can add the parameters to your function. And by passing the values you get the function to do specific set of the things. You can see that if you master how to use the functions properly you can easily manage your code and also get repeat work done as well. I hope you learned the concepts through this small video. I'd love to see your comments.
If you want to try out the similar game development tutorials using the gdevelop, you can follow this tutorial trail of GDevelop Tutorials.
I hope the current tutorial was useful to you.
We will continue the further game development topic in next post.