Skip to content

Lesson 13: Ignore "type" word and remove whitespaces #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions course/lesson-13-conditions/lesson.tres
Original file line number Diff line number Diff line change
@@ -106,11 +106,11 @@ title = ""
type = 0
text = "When the computer checks a condition, this is called [b]to evaluate[/b] a condition. All conditions [b]evaluate[/b] to either [code]true[/code] or [code]false[/code].

Either the player is pressing the button, or not. Either the character is touching an enemy, or not.
Either the player is pressing the button, or not. Either the character is touching an enemy, or not.

In our case, [i]if[/i] the health goes over a maximum value, we want to reset it to the maximum.

To define a condition, we use the [code]if[/code] keyword. We write a line starting with [code]if[/code], type the condition to evaluate, and end the line with a colon."
To define a condition, we use the [code]if[/code] keyword. We write a line starting with [code]if[/code], [ignore]type the condition to evaluate, and end the line with a colon."
visual_element_path = ""
reverse_blocks = false
has_separator = false
@@ -130,7 +130,7 @@ script = ExtResource( 5 )
content_id = "res://course/lesson-13-conditions/content-0c7DDizK.tres"
title = ""
type = 0
text = "Notice the [code]>[/code] comparison sign. We read this symbol as \"greater than\".
text = "Notice the [code]>[/code] comparison sign. We read this symbol as \"greater than\".

We've seen how function definitions use a colon at the end of the first line and nest content inside.

@@ -270,7 +270,7 @@ As a reminder, the comparison signs are:
!= not equal to
[/code]

The line [code]health < 5:[/code] means \"health is less than 5\".
The line [code]health < 5:[/code] means \"health is less than 5\".

Because [code]health = 100[/code], this is false so [code]print(\"health is greater than five.\")[/code] won't run."
starting_code = "func run():