Tutorial 6: Basic Conditional Statements in GDScript

GDScript of Basic Conditional Statements

The basic GDScript conditional statements shown above is pretty much straightforward. It simply uses the if, elif and else statements. You can download the source code here.

In the example, the second condition is satisfied because a is less than 9, as shown in the image below.

Output Console

As for your practice, try changing 7 equal to 1 or any number greater than 9 and see the results.

Related Posts:

  • Tutorial 5: Basic Functions in GDScript Part 2 GDScript for Determining an Even or Odd Number This is the second part of the function tutorial. Please study the previous tutorials before studying this one; it builds from the concepts of the past tutorials 1 to 4. The… Read More
  • Tutorial 4: Basic Functions in GDScript GDScript with Basic Functions Declaring a function in GDScript is not difficult; just like what is shown in the image above. You can declare a function with func someFunctionName(some_variable): , but I prefer declaring i… Read More
  • Tutorial 3: Basic Operators in GDScript GDScript Basic Operators In this tutorial, you'll learn how to use the basic operators like addition, subtraction, multiplication and division used in the compound interest formula, as shown above. You can download the so… Read More
  • Tutorial 6: Basic Conditional Statements in GDScript GDScript of Basic Conditional Statements The basic GDScript conditional statements shown above is pretty much straightforward. It simply uses the if, elif and else statements. You can download the source code here. In th… Read More
  • Tutorial 2: Basic Variables in GDScript GDScript with Specific Variable Types and Scoping The image above shows a GDScript with basic variables declared with specific types, and with proper scoping. You can download the source code here. In this example, we so… Read More

0 comments:

Post a Comment

© 2020 by Emman Lijesta, all rights reserved. Powered by Blogger.