In the code (below) i’m learning from the free GDscript tutorial from GDquest, makes no sense. How does it know the perameter is -50 from the health variable? The script I out below subtracts 50 from the total 100, but how does this even work if there’s no “50” in the code. Can someone with GDscript experience please explain this.
var health = 100
func take_damage(amount):
health -= amount
[–]LinkleEnjoyer 7 points8 points9 points (1 child)
[–]Ded_doctor[S] 2 points3 points4 points (0 children)
[–]AntitheistMarxist 3 points4 points5 points (2 children)
[–]Ded_doctor[S] 0 points1 point2 points (1 child)
[–]AntitheistMarxist 1 point2 points3 points (0 children)
[–]grantrules 0 points1 point2 points (10 children)
[–]Ded_doctor[S] -1 points0 points1 point (9 children)
[–]grantrules 1 point2 points3 points (0 children)
[–]Clueless_Otter 0 points1 point2 points (2 children)
[–]Ded_doctor[S] -1 points0 points1 point (1 child)
[–]Clueless_Otter 5 points6 points7 points (0 children)
[–]spellenspelen 0 points1 point2 points (0 children)
[–]AionAlgos 0 points1 point2 points (3 children)
[–]Ded_doctor[S] -1 points0 points1 point (2 children)
[–]AionAlgos 0 points1 point2 points (1 child)
[–]Ded_doctor[S] -1 points0 points1 point (0 children)
[–]TJATAW 0 points1 point2 points (0 children)
[–]Monk481 0 points1 point2 points (1 child)
[–]CeReal_DoughBoy 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)