battleship j2me mobile game frank ng. approach installed j2me and eclipse to edit the java code...
TRANSCRIPT
![Page 1: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/1.jpg)
Battleship
J2ME Mobile Game
Frank Ng
![Page 2: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/2.jpg)
Approach
• Installed J2ME and Eclipse to edit the Java code• Learned J2ME/Java by looking at example code• Created a basic flowchart for basic functionality
– Corrected as I programmed– Once I had basic functionality, I would expand if there
is more time• Used the examples and the flowchart to create
Battleship– Networking example Socket client.java,
sender.java, server.java– Tilepuzzle example board.java
![Page 3: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/3.jpg)
Flowchart
Start
Setup layout of ships
Choose player number (to be
server or client)
Is it your turn?
Guess a square, send guess
coordinates to opponent
Receive Hit message from
opponent?
Receive miss message from
opponent?
Color the square RED
myturnP = false;
All ships sunk?
Color the square BLUE
Display winner information
Finished
Received guess
coordinates?
Is the guess a MISS?
Is the guess a HIT?
Color board blue, and send message
that guess is a miss
Color board blue, and send message
that guess is a miss
NoNo
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Frank NgEE-194WIRProf. Chang
![Page 4: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/4.jpg)
Screenshot – Setup of board
![Page 5: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/5.jpg)
Screenshot – Finish Setup
![Page 6: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/6.jpg)
Screenshot – Choose player
![Page 7: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/7.jpg)
Screenshot – Start Playing
KeyWhite – Blank Square
Blue – Miss
Red – Hit
Grey – Ship
![Page 8: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/8.jpg)
Screenshot – Game Finished
![Page 9: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/9.jpg)
Conclusion
• Good overall learning experience– Learned from example– J2ME WTK– Java– Networking
![Page 10: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/10.jpg)
Conclusion – Cont’d
• Could have implemented more functionality/aesthetics given more time– Create “explosions” when player gets a hit
• Also use other images for misses, ships, etc.
– Detect if player setup ALL of the ships– Make it easier to setup the ships– Notification when a connection has been made
between the client and server– etc.
![Page 11: Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code Learned J2ME/Java by looking at example code Created a](https://reader036.vdocument.in/reader036/viewer/2022062322/56649ccb5503460f94993ee3/html5/thumbnails/11.jpg)
Questions/Comments?