devilish666@lemmy.world to Programmer Humor@lemmy.ml · 3 months agoAaargh....my eyes......my eyes......lemmy.worldimagemessage-square5fedilinkarrow-up12arrow-down10
arrow-up12arrow-down1imageAaargh....my eyes......my eyes......lemmy.worlddevilish666@lemmy.world to Programmer Humor@lemmy.ml · 3 months agomessage-square5fedilink
minus-squarecookie_sabotage@sh.itjust.workslinkfedilinkEnglisharrow-up1·3 months agopublic class GameManager : MonoBehaviour { public bool EnableHighContrast; public bool PlayerWon; public float PlayerUnitsMoved; public int PlayerDeathCount; public float PlayerHealth; public void PlayerTakeDamage(float damage) { PlayerHealth -= damage; if (PlayerHealth < 0) { PlayerDieAndRespawn(); } } public void PlayerDieAndRespawn() { return; } } I couldn’t contain myself.
minus-squareWise@feddit.uklinkfedilinkEnglisharrow-up0·3 months agoShould it be PlayerHealth <= 0 ? Otherwise the player could have 0 health and not die? I’m sleep deprived so forgive me if I’m wrong
minus-squareWise@feddit.uklinkfedilinkEnglisharrow-up2·3 months agoCounting this meme as my first FOSS contribution
public class GameManager : MonoBehaviour { public bool EnableHighContrast; public bool PlayerWon; public float PlayerUnitsMoved; public int PlayerDeathCount; public float PlayerHealth; public void PlayerTakeDamage(float damage) { PlayerHealth -= damage; if (PlayerHealth < 0) { PlayerDieAndRespawn(); } } public void PlayerDieAndRespawn() { return; } }
I couldn’t contain myself.
Should it be
?
Otherwise the player could have 0 health and not die? I’m sleep deprived so forgive me if I’m wrong
You are correct.
Counting this meme as my first FOSS contribution