Monopoli Game with C++

Sabtu, 23 Juli 2011

Basic Theory:

Games that we make is a monopoly game. This game uses the C + + programming language. This game is made in the form of a GUI instead of CLI. In making this game, using a data structure, where the data structures that we use is the single linked list.

Graphical User Interface (GUI) is one model of interaction between humans and computers. In addition to the GUI, there are also other models such as Character User Interface (CUI) that often we are familiar with the command line. In terms of comfort (attitude), both models have a 'penganut'nya respectively. Adherents of CUI is usually a system administrator based on LINUX operating system. For them, CUI felt more comfortable than the GUI, even after the GUI in Linux is growing rapidly, they persisted to use the CUI. Adherents of the GUI are usually those who are already familiar with the Windows operating system. For them, the GUI is set in stone is not negotiable.

Monopoly Game is one of the most famous board game in the world. The game objective is to master all the plots on the board through the purchase, rental and exchange properties in a simplified economic system. Each player in turn throws the dice to move bidaknya, and when he landed on the plots that have not owned by another player, he can buy the appropriate patch listed price. If the plot had been bought another player, he must pay the player the rent amount has also been established.

The data structure is the way of storage, preparation and arrangement of data within computer storage media so that data can be used efficiently. In programming techniques, data structure layout means that the data contains columns of data, whether the column is visible by the user (the user) or columns that are only used for programming that is not visible to users. Each line of a collection of columns is called a record (record). Column width for data may change and vary. There is a column whose width changed dynamically according to input from users, and there is also a fixed width columns. By its nature, a data structure can be applied to the database processing (eg for purposes of financial data) or for word processing (word processor) that is dynamically changing columns. Examples of data structures can be seen in the papers spread sheet (spreadsheet), the base-data (database), word processing, image dipampat (compressed), also compressing the file with a specific technique that utilizes a data structure.

Single Linked List is the number of nodes are connected linearly with the aid of a pointer. Said to be singly (single) linked if there is only one pointer that connects each node. Singly pointer field means its only one fruit and one direction only. In data storage in a single linked list, we use the FIFO (First In First Out), so the first data entry will be the first data to be displayed, so if you want to find the data should start from the initial data.

We use a single linked list to store data when the city purchased, with details of the data masing2 have "Index", "price", and "milik1". Where Index is the location of the town is in index into how much, price is the price the city who bought it, and milik1 is the data which we distinguish the city's player1 or 2.

Game demos:


Gambar 1.1 Display Game

Gambar 1.1 a display of games we make. There are 18 cities with the price of each city areavailable at this monopoly. This game is only available for 2 players can not be less, not more. And in this game, we only provide the initial capital amount of salary or 2000, and eventually each player will receive a salary for a number of 1000 whenthey passed the first round. When I passed one round there will be a warningmessagebox that salary has been received, such as gambar 1.2

Gambar 1.2 Message Box

After this is the way to play this game:
  1. The first player must click the middle button of existing dice dice. When the dice on click, he will randomize the numbers automatically, and the numbers indicated bythe dice is a number which the player is running. When walking, the location ofplayers and the money will be demonstrated by the existing textbox in the middle.

  2. Gambar 1.2 Display lokasi dan uang.

  3. When it came to disuatu town, a player can buy a city where it is located. And in the key box will display the number of the city where the figure is a player, eg player 1,will come out number 1. To purchase, just click the buy button.
  4. When a player has finished the sale of the city, he can stop the turn to anotherplayer who went the other player's turn. To stop the turn, the players just mengklibutton up there in the middle.
  5. Gambar 1.5 Display Tombol Lanjut dan messageBox giliran

  6. When the player clicks on the button while he was clicking on the dice before the dice, then there will be warnings like the following:
  7. Gambar 1.6 Peringatan bahwa bukan giliran player tersebut

  8. When a player runs and located in the city that have been purchased by anotherplayer, the player must pay to the player who has the city. Price to be paid in accordance with the purchase price of the city.
  9. Gambar 1.7 Peringatan Player tersebut harus membayar uang

  10. Player can sell the city already owned by clicking a button from the city that will be sold. But can only be done when the player's turn.
  11. When the money owned player is less than 0, then the player is declared lost.

    Source Code dan program can be downloaded Here :
  12. 0 komentar:

    Posting Komentar

     
     
     

    Label

    Label