Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code...

11
Battleship J2ME Mobile Game Frank Ng

Transcript of Battleship J2ME Mobile Game Frank Ng. Approach Installed J2ME and Eclipse to edit the Java code...

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Questions/Comments?