Changes

Jump to: navigation, search

Teams Winter 2011/team4/lab4

536 bytes added, 17:25, 27 March 2011
no edit summary
=Lab 34=
*[http://zenit.senecac.on.ca/wiki/index.php/Teams_Winter_2011/team4 Teampage]
 
==Tutorial==
*Launch Eclipse
*Create new BlackBerry Project: ''File->New->BlackBerry Project''
[[File:T4_1.png]]
*Set the title of the project
[[File:T4_3.png]]
===Add Elements on Main Screen===
*Place a applications icon into ''res->image''
*Open ''BlackBerry_App_Descriptor''
*Select the icon, click the ''Add'' button
[[File:T4_2.png]]
===Define the Application===
*Create the classes StartScreenMyApp, PlayerOneMyScreen, and PlayerTwoNextScreen[[File:T4_4.png]]*StartScreen will setup MyApp create instances of both MyScreen and NextScreen, allowing the user to navigate between screens. This is by immediately pushing Myscreen and then adding a changeListener to the environment for our applicationbutton on MyScreen to navigate to NextScreen[[File:T4_5.png]]*Both Player classes The NextScreen Class will contain create setup the code tic tac toe board and request user input for what is to be displayed per their moves. It does not allow invalid input, and once a piece has been placed, the respective players turnuser cannot place another piece on that square.*After the a player makes a move, the screens will swap and the other next player will take is requested to place their turn while their screen move and so on until a winner is determined, it is currently showinga tie game, or the reset button has been pressed.
===Starting the Game===
*Implement the code to create the menu
[[File:T4_9.png]]
*Add a start game button
*Allow the start game button to switch screens
[[File:T4_10.png]]
===Creating the PlayerBoard===*Create the player constructorboard only once[[File:T4_7.png]]
*Implement the ability for a ''player'' to take their turn
[[File:T4_8.png]]
*Allow the game to switch players after a turn
*When the players screen is displayed is it considered their turn
 
===Ending the Game===
*Within the player classes, implement terminal state checking
[[File:T4_6.png]]
*Before a players move, is there space to go?
**No, the game is over directing the player to the main screen
[[File:T4_12.png]]
**Yes, the game is not over and the player may take their turn
*After a players move, does that that move win the game?
[[File:T4_11.png]]
**No, the game is not over and the next ''player's'' screen is displayed
**Yes, the game is over directing the player to the main screen

Navigation menu