Skip to main content

A HeroGame implemented for demonstration purposes

Project description

Game Hero

The project developed covers a story game based on turn based combat, where the game hero encounters a wild beast in the forest. Game character's stats are taken into consideration on each turn, whilst the game herop also possesses some additional skills to help him in battle.

The story

Once upon a time there was a great hero, called Orderus, with some strengths and weaknesses, as all heroes have. After battling all kinds of monsters for more than a hundred years, Orderus now has the following stats:

  • Health: 70 - 100
  • Strength: 70 - 80
  • Defence: 45 – 55
  • Speed: 40 – 50
  • Luck: 10% - 30% (0% means no luck, 100% lucky all the time).

Also, he possesses 2 skills:

  • Rapid strike: Strike twice while it’s his turn to attack; there’s a 10% chance he’ll use this skill every time he attacks
  • Magic shield: Takes only half of the usual damage when an enemy attacks; there’s a 20% change he’ll use this skill every time he defends.

Gameplay

As Orderus walks the ever-green forests of the Game, he encounters some wild beasts, with the following properties:

  • Health: 60 - 90
  • Strength: 60 - 90
  • Defence: 40 – 60
  • Speed: 40 – 60
  • Luck: 25% - 40%

The game simulates a battle between Orderus and a wild beast. On every battle, Orderus and the beast are initialized with random properties, within their ranges.

The first attack is done by the player with the higher speed. If both players have the same speed, than the attack is carried on by the player with the highest luck. After an attack, the players switch roles: the attacker now defends and the defender now attacks.

The damage done by the attacker is calculated with the following formula: ~ Damage = Attacker strength – Defender defence

The damage is subtracted from the defender’s health. An attacker can miss their hit and do no damage if the defender gets lucky that turn. Orderus’ skills occur randomly, based on their chance on each turn.

Game over

The game ends when one of the players remain without health or the number of turns reaches 20. The application outputs the results for each turn: what happened, which skills were used (if any), the damage done, defender’s health left. Additionally, a winner may be declared if we have a winner before the maximum number of rounds is reached.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

game_hero-1.0.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

game_hero-1.0.0-py3.7.egg (19.4 kB view details)

Uploaded Egg

game_hero-1.0.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file game_hero-1.0.0.tar.gz.

File metadata

  • Download URL: game_hero-1.0.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3

File hashes

Hashes for game_hero-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9b64f2f31923c06c68587bd62a26673ed805f2b46b646256281c6f085f49e513
MD5 6b9432fa968d98c4b42c1ac4d4c740c1
BLAKE2b-256 066d70c19e16dc2c474730c816dee57dac238bcc93943c7d0ed5d46c8fedda4b

See more details on using hashes here.

File details

Details for the file game_hero-1.0.0-py3.7.egg.

File metadata

  • Download URL: game_hero-1.0.0-py3.7.egg
  • Upload date:
  • Size: 19.4 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3

File hashes

Hashes for game_hero-1.0.0-py3.7.egg
Algorithm Hash digest
SHA256 ee58f43fab479b5f60d8bf837994409b36df31d600c332a9c5fcfb8671b30bdf
MD5 578ba6e040c2dc4d73c67fd6236edc5c
BLAKE2b-256 21507dc5bbf816da27822b0ed941d214f29a891ad69a5138025f3ad13612f765

See more details on using hashes here.

File details

Details for the file game_hero-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: game_hero-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.3

File hashes

Hashes for game_hero-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 612a9c93ae59cdd819b48a57535353105bc9a78b5336033b6335d1497be0a755
MD5 eacf97e427ff256a70ade8d069140d5b
BLAKE2b-256 eab41d6c989b78cb0b72d2b891b7c7737584ef0aa61fda4f76d2e80369e49dd8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page