I'm very new so bare with me please, just starting to learn Godot and the classes online I'm taking don't have a spot where I can ask questions to anyone only an AI bot. I'm struggling to figure out what the differences in these two codes are and why you would want one over the other. Thanks.
Challenge: Create a function called _has_won.
This function has a parameter called score.
It needs to return true or false for whether or not the score is above 100.
My attempt:
var score : int = 100
func _ready():
_has_won (score)
func _has_won(score):
if score >= 100:
print("You Win")
The way I was supposed to write it:
func _ready():
var game_over = _has_won(120)
print(game_over)
func _has_won(score):
if score>=100:
return true
else:
return false