This might work for a game, but it's by no means secure. Use Scrypt or Argon2 for a secure password hashing function. SHA-512 is a general-purpose hash function, it's very fast and uses little memory. For password hashing you want tuneable performance (to slow down brute force) in both time and memory. You also need a unique salt for each password. In your case it sounds like there's only one password, so a salt is less useful, but it's better to get in the habit of doing things properly.