Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

MDCO

4
Posts
2
Topics
A member registered Feb 12, 2024 · View creator page →

Creator of

Recent community posts

Great, and fun, thx!

Is there an option for contacting a developer?

(2 edits)

Adding a GDScript

You can add a Godot script by attaching it to a node. The name of the script is from a node name. So, changing a root node name from a generic one is wise. Then, after you click on a node twice, you can rename it. When adding a script, click to micro button scroll-like with the green plus sign to add it. Another option is to press the right button and select the "attach" script. GDScript is a default script language for coding in Godot. Use a template with a simple code part (default) in the beginning, and later you can select a blank or script without comments. Finally, click "create" in the attached node script dialog window.

Hello World example

First, we will learn the command "print" with one string, and we can see the result of this code in the output window. So, after starting the scene, we will see the "hello world" in the output window. After, we will set a variable, an integer, and print it with the print command. Suppose you use a string variable like the variable "text"; you must put it under quotation marks. Then, write code under the "ready" function.

func _ready():
    var text = "Hello World"
    print(text)

To test your coding, press F6 or click once on the "Run Current scene" micro button. The text can be seen in the output window. It is crucial to declare every variable you intend to use when performing mathematical calculations.

var a = 2
var b = 2
var c
c = a + b
print(c)

If you want to connect part of the text, we use the "+" sign. Unfortunately, you cannot print integer variables and strings together till version 4, but with the "str" command, you can change an integer to a string and then print it on the screen. In the Godot 4 use the following syntax.

print("Result is: " , c) 

To print an integer along with a string in the Godot 3.5 example, it is necessary to utilize the "str" function.

print("Result is: " + str(c)) 

Comments

In GDScript, you can write a one-line comment or use symbols for multi-line commenting. For one line, use #, and multi-line, use'''.

# This is a one-line comment
''' This is a
multi-line
comment '''

(1 edit)

 GDScript is a Godot game engine script for game development. A developer can make:

  • 2D games,
  • 3D games, or
  • Applications established at the control scene environment.

Godot in version 4 and after is available to download from the Godot website. You can download it for various platforms. The game engine is a compact 50 megabytes, making it easy to download.

Marijo Trkulja boasts over three decades of expertise in instructing computer science-related courses and subjects, making him a highly accomplished author in the field.

This tutorial covers:

  • GDScript fundamentals.
  • Advanced concepts.
  • Practical examples and exercises.
  • Verified GDScript code with Godot 4 and Godot 3.5.

Through the teaching of the book, you will learn to make Tetrizoo, the Tetris, logic type game. After you grasp the fundamental coding concepts laid out in the first 30 pages, game development commence.


The Tetrizoo development is complex, but after it, you will be able to address almost any codding situation in the 2D or 3D game development.

Detailed explanations of nodes can be found, such as RigidBody3D, which are thoroughly elucidated with comprehensive coverage of their properties, methods, and accompanied by illustrative examples.

Throughout all of the content, it is important to note that the learning material is presented using:

  • GDScript (Godot 4 and later).
  • Additionally, the beginner section includes examples using GDScript 1.0 (Godot till 3.5).

This content is specifically designed for coders, so it does not contain a lot of images or graphics. Keep in mind that it is not intended to be a picture book for toddlers; instead, it is a true masterpiece for GDScript wizards.

The educational approach employs examples, tasks, and sequential instructions to enhance comprehension of the teaching material. Utilize these resources judiciously for optimal learning outcomes.

The Author wish you all the best in your exploration of the GDScript.