he/him

Nerd, programmer, writer. I like making things!

  • 8 Posts
  • 177 Comments
Joined 2 years ago
cake
Cake day: June 20th, 2023

help-circle






  • Oops, I wasn’t clear! I appreciate the thought process there, I’ll be more detailed.

    My first note was for the type hint. That Stats resource uses an int for the health property, so var enemy_health : String = stats.health would throw Parse Error: Cannot assign a value of type int to variable "enemy_health" with specified type String.
    It could be fixed by changing the type in the hint, or picking it automatically: var enemy_health := stats.health

    The confusion muddied up my second point, you can replace:

    print("This enemy has ", enemy_health, " health!")
    

    with:

    prints("This enemy has", enemy_health, "health!")
    

    Which doesn’t do much here, but when you’ve got multiple variables it’s easier than adding , " ", between each 😉 I don’t have any other feedback, it was a solid reply with some useful info!























OSZAR »