top of page

Object Oriented - Map Game

  • תמונת הסופר/ת: Remi Bettan
    Remi Bettan
  • 1 בנוב׳ 2016
  • זמן קריאה 2 דקות

A real game has been programmed during this project. At the end of it, many programmers enjoyed playing with it, which seems to be an objective criteria for a successful game.

The game consists of a Hero (the player) going from one room to the other in the game Map.

Each Room can have a Monster in it, a Treasure, or nothing:

- If there is a treasure in the Room, the Hero may take it.

- If there is a Monster, the Hero may fight with it in order to gain the treasure which is in the Monster's property.

End of the Game:

- The Hero wins the game if he earns 1000 coins.

- He looses the game if he dies.

Below is the Executive Diagram of this Project:

Executive Diagram

In order to make this game "Open-Close" - as required from the SOLID OOD Principles - the implementation had to include as less "if" statements as possible.

The Data for the map itself was provided by a text file which included 2 parts:

- The first part was the information on each room separately. Each detail of the room was separated by a predefined delimiter.

- The second part of this text file was the map itself, which included the location of the each room relative to the others. See map example below:

The main design tools used for this project were:

- callbacks - used for example to make the class responsible of creating all the rooms and monsters (called Builder) to call their constructors.

- states - used for example to change the state of a room from Monster room to Treasure room after a monster has died.

Besides those, regarding the developing strategy, we used the Agile method:

EACH DAY, we decided of the scope of work of each member of the team and we finished the day with the game compiling and running, each day with more and more features.


 
 
 

תגובות


The Science & 

Mathematics University

© 2023 by Scientist Personal. Proudly created with Wix.com

  • Facebook Clean Grey
  • Twitter Clean Grey
  • LinkedIn Clean Grey
bottom of page