Docsity

Tic Tac Toe Android Game Document, Slides of Project Management

Partial preview of the text

Download Tic Tac Toe Android Game Document and more Slides Project Management in PDF only on Docsity!

Index

Sr. No. Contents Page No.

1. CHAPTER 1 : OBJECTIVES^ 1

2. OVERVIEW

2.1 Players

2.2 Theory of Game

3. Core Logic^ -^ AI^ 5

4. Core Logic - Humans^ 8

5. PROJECT SPECIFICATION^ 9

6. CLASSES^ 10

7. METHODS AND FUNCTIONS^ 12

8. TESTING AND IMPLEMENTATION

8.1 Screen Shots and Images

9. LIMITATIONS^ 27

10. FUTURE PLAN^ 27

11. BIBLOGRAPHY^ 28

• Objectives:

Our project name is Tic-Tac-Toe (PT3 Game) game. PT3 Game full form is P-“Priyanka” and T3-“Tic-Tac-Toe ” Game. This game is very popular and is fairly simple by itself. It is actually a two player game. In this game, there is a board with n x n squares. In our game, it is 3 x 3 squares. The goal of Tic-Tac-Toe is to be one of the players to get three same symbols in a row – horizontally, vertically or diagonally – on a 3 x 3 grid.

• Overview:

- Theory of Game: A first player have by default “X” symbol and opponent have “O” symbol. If first player tap on any block then automatically draw “X” symbol, then the second player have to play with “O” and vice versa. A player marks any of the 3x3 squares with his symbol (may be “X” or “O”) and his aim is to create a straight line horizontally or vertically or diagonally with two intensions:

  • Create a straight line before his opponent to win the game.
  • Restrict his opponent from creating a straight line first. In case logically no one can create straight line with his own symbol, the game result a tie. Hence there are only three possible results – a player wins, his opponent (both humans) wins or it’s a tie. Note: (When game is tie then click above Play gain button and start gain the game.)

Figure: 2. If any player is able to draw three X’s or three O’s in the following combinations then that player wins. The combinations are:

- Vertically: - 1,4, - 2,5, - 3,6, - Horizontally: - 1,2, - 4,5, - 7,8,

Figure: 3. The following case happen win positions happen:

  • Figure: 3.
  • Figure: 3.

• Project Specification:

The Tic-Tac-Toe Game is made by Android Studio using XML and Java language. In Android Studio we have two options there first one is- drag & drop feature and another is- you can write XML file to design our project layout as well as components. I made Tic-Tac-Toe game using both options – using XML as well as drag & drop feature. I used Linear Layout in main XML file, in Linear Layout used one Vertical Layout. In Vertical Layout I have used three Horizontal Layouts to partition nine blocks and these background, I set the main basic grid image shown in Figure: 2.1. Once, basic layout is done then after I put images like X and O inside Linear Layout – each Horizontal Layout. After put images then write java code for actually work for Tic-Tac-Toe game logic.

• Classes:

- Class for Splash Screen (SplashActivity.java): In this class, first show the game splash screen for more attractive game, that’s show 4 seconds because I used Java Thread concept. After 4 seconds automatically the game main screen will be open. Figure: 6. - Class for Main activity for game:

These are shown in below: Figure: 6.

• Methods & Functions:

The methods & functions we used in our program are as follows:

- public void playerTap (View view): When both player tap an image and immediately show X or O on each block respectively. Before tapping an each particular block below Text Box show a message like “X’s Turn – Tap to play”.(Figure: 7.1)

Figure: 7.

- public void gameReset (View view): This method works after X or O player has won. Then automatically call the gameReset() function and restart newly the Tic-Tic-Toe game. - Protected void onCreate (Bundled savedInstanceState): For use (MainActivity.java) - This method is use for set the background music on buttons like On & Off music shown in Figure: 6.3. For use (SplashActivity.java) - This method is use for Splash Screen activity when application is open, then this screen will be show for 4 seconds. - public void backPress (View view):

• Testing & Implementation:

Screen Shots and Images – When download and install application in Mobile these look like below screen shots;

- I used application symbol-

  • Splash Screen-

- X player symbol-

- O’s won-