Skip to content

kox13/virutal-world-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual World Simulator

A turn-based virtual world simulator implementing object-oriented programming principles in C++. The project features a 2D grid world populated by various animals and plants with unique behaviors.

Building the Project

Requirements

  • Windows operating system
  • Visual Studio (with C++ support)

Build Instructions

  1. Open the .sln solution file in Visual Studio
  2. Build the solution (F7 or Build → Build Solution)
  3. Run the executable from the output directory

Game Mechanics

Controls

Enter - Next turn / Confirm player's move
Arrows - Move cursor (when player's turn)
E - Special ability (when player's turn)
L - Save Game
M - Main Menu
Q - Quit

How to Move the Human

  1. Press Enter to start the turn
  2. Use Arrow keys to select the destination field
  3. Press Enter again to confirm the move

Organisms

The world contains two types of organisms:

Animals

  • Human (H) - Player-controlled character

    • Strength: 5, Initiative: 4
    • Special ability available every 10 turns (active for 5 turns)
    • Color: Light Magenta
  • Wolf (W) - Aggressive predator

    • Strength: 9, Initiative: 5
    • Color: Gray
  • Sheep (S) - Peaceful herbivore

    • Strength: 4, Initiative: 4
    • Color: White
  • Fox (F) - Cunning animal with keen sense of smell

    • Strength: 3, Initiative: 7
    • Never moves to a field with a stronger organism
    • Color: Dark Yellow
  • Turtle (T) - Slow but defensive

    • Strength: 2, Initiative: 1
    • 75% chance to stay in place
    • Deflects attacks from organisms with strength < 5
    • Color: Dark Green
  • Antelope (A) - Fast runner

    • Strength: 4, Initiative: 4
    • Movement range: 2 fields
    • 50% chance to escape before combat
    • Color: Yellow

Plants

  • Grass (0) - Basic plant

    • Strength: 0
    • Color: Green
  • Milkweed (M) - Aggressive spreader

    • Strength: 0
    • Makes 3 spreading attempts per turn
    • Color: Dark Magenta
  • Guarana (+) - Strength booster

    • Strength: 0
    • Increases the strength of the animal that eats it by 3
    • Color: Light Red
  • Wolfberry (!) - Deadly poison

    • Strength: 99
    • Animal that eats it dies
    • Color: Red
  • Sosnowsky Hogweed (*) - Dangerous plant

    • Strength: 10
    • Kills all adjacent animals each turn
    • Animal that eats it dies
    • Color: Dark Red

Game Rules

  1. Turn Order: Organisms move based on initiative (higher initiative moves first). In case of equal initiative, older organisms move first.

  2. Combat: When two organisms occupy the same field:

    • The organism with higher strength wins
    • In case of equal strength, the attacker wins
    • Defeated organism is removed from the world
  3. Reproduction: When two animals of the same species collide, they don't fight. Instead, a new organism of that species appears in an adjacent empty field.

  4. Plant Spreading: Each turn, plants have a chance to spread to adjacent empty fields.

Symbol Legend

Symbol Organism Type
H Human Animal
W Wolf Animal
S Sheep Animal
F Fox Animal
T Turtle Animal
A Antelope Animal
0 Grass Plant
M Milkweed Plant
+ Guarana Plant
! Wolfberry Plant
* Sosnowsky Hogweed Plant

Special Abilities

The Human character has a special ability:

  • Can be activated by pressing E

  • Remains active for 5 consecutive turns

  • Cannot be reactivated for 5 turns after deactivation

  • Burns all organisms around the Human

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors