This code makes no sense.

Posted by Ded_doctor@reddit | learnprogramming | View on Reddit | 20 comments

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