Giter VIP home page Giter VIP logo

prog8051-assign2's Introduction

Gem Hunters Game

Gem Hunters is a simple console-based 2D game where players compete to collect the most gems within a set number of turns.

Objective

The objective of the game is to collect as many gems as possible within 30 moves (15 turns for each player). Players can move their character around the board and collect gems while avoiding obstacles.

Features

  • Board Size: A 6x6 square board.
  • Players: 2 player game. Player 1 starts in the top-left corner and Player 2 starts in the bottom-right corner.
  • Gems: Randomly placed on the board at the start of the game. Gems do not move once placed.
  • Obstacles: Random positions on the board that players cannot pass through.
  • Turns: Players alternate turns, with each player getting 15 turns.
  • Winning: The player with the most gems collected after all turns are exhausted wins. If both players have the same number of gems, it's a tie.

How to Play

  1. Clone the Repository:

    git clone https://github.com/EdisCode/PROG8051-Assign2.git
  2. Navigate to the Project Directory:

    cd PROG8051-Assign2
  3. Run the Application:

    dotnet run
  4. Follow On-screen Instructions:

    • Input your moves (U for up, D for down, L for left, R for right).
    • Collect gems while avoiding obstacles.
    • The game ends after 30 moves or when all gems are collected, and the player with the most gems wins.

Implementation Details

The game is implemented in C# and consists of the following classes:

  • Position: Represents a position on the game board.
  • Player: Represents a player in the game, with methods for moving and collecting gems.
  • Cell: Represents a cell on the game board, which can contain a player, gem, obstacle, or be empty.
  • Board: Represents the game board, with methods for initializing the board, displaying the current state, and validating moves.
  • Game: Manages the game state, including player turns, total turns, and win conditions.

Video Link

Follow this Link to watch the implementation video.

Enjoy the hunt! ๐ŸŽŠ And remember finders keepers. ๐Ÿ˜‰

prog8051-assign2's People

Contributors

ediscode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.