Lesson 3: Practice Time!
Lesson 3: Practice Time!
Lets say youre making a game with magic potions. Potions have different effects they can heal players or hurt them. You would want to declare and initialize some constants and variables to store player health, and the amount of damage or healing caused by a potion.
Let’s say you’re making a game with magic potions. Potions have different effects — they can heal players or hurt them. You would want to declare and initialize some constants and variables to store player health, and the amount of damage or healing caused by a potion.
Let’s say you’re making a game with magic potions. Potions have different effects — they can heal players or hurt them. You would want to declare and initialize some constants and variables to store player health, and the amount of damage or healing caused by a potion.
But which should be constants, and which should be variables?
| | var PlayerHealth: float = 100.0 |
| --- | --- |
| | PotionDamageAmount: float = 20.0 |
| | PotionHealAmount: float = 10.0 |
Copy full snippet
The variables and constants you're changing here won’t affect your Fortnite character's health, but you will learn how to do exactly that in a later lesson!
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.