C++ Simple Game.

Discussion in 'Game programming' started by united07, May 24, 2010.

  1. united07

    united07 New Member

    May 24, 2010
    Likes Received:
    Trophy Points:
    The Predator‐Prey game is a simple board game where a set of predators and preys move freely across the board. The goal of the game is that predators eat all the preys available.

    The following is a description of the game rules:

    1) Predators and preys move on a 2‐dimensional closed grid of size 12x12 cells. Predators and preys are not allowed to move outside the grid.

    2)There are two kinds of predators: snakes, and scorpions. On the other hand, there are three kinds of preys: bugs, ants, and worms.

    3) Scorpions eat bugs and ants but not worms, while snakes eat worms and bugs but not ants.

    4) The game consists of successive turns. During one turn, each of the creatures moves one step into one of the adjacent cells (up, down, left, or right). If there is no empty adjacent cell, the creature stays in its place during this turn.

    5)Predators’ movements are controlled by the user, while preys move randomly.

    6) Each turn starts by prompting the user to move each of the predators, then the preys take their turn and each of them moves one random step.

    7) A predator breeds if it survives for 24 moves, while a prey breeds if it survives for 12 turns. The new offspring is of the same type, and is added into one of the adjacent cells (top, bottom, left, or right). Naturally, if there is no empty adjacent cell no breeding takes place.

    8) A predator eats a prey if it is in one of the predator’s adjacent cells (top, bottom, left, or right) and is of the proper type.

    9) A predator starves and dies if it moves 12 turns without eating a prey.

    the program should display the game board along with the current creatures. Use the characters ‘S’ for snakes, ‘X’ for scorpions, ‘B’ for bugs, ‘A’ for ants, and ‘W’ for worms.
    Initialize your game board with 1 snake, 1 scorpion, 12 ants, 12 worms, and 12 bugs. Place them in random locations.
  2. unni krishnan.r

    unni krishnan.r Member

    Apr 20, 2010
    Likes Received:
    Trophy Points:
    Home Page:

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice