Royal Institute of Technology (KTH) Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications ID 2216 – Developing Mobile Applications By Sun Gang By Sun Gang A P2P Bluetooth Game based on A P2P Bluetooth Game based on J2ME: J2ME: WordWar WordWar Sun Gang Sun Gang Zhang Gang Zhang Gang Wu Xiao Wu Xiao 11th March 2008 11th March 2008
19
Embed
Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications By Sun Gang A P2P Bluetooth Game based on J2ME: WordWar Sun Gang Zhang Gang.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications By Sun GangBy Sun Gang
A P2P Bluetooth Game based on A P2P Bluetooth Game based on J2ME:J2ME:WordWarWordWar
Sun GangSun GangZhang GangZhang Gang
Wu XiaoWu Xiao
11th March 200811th March 2008
Slide 2
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Project Description
Our project is to develop a peer-to-peer word guessing game with J2ME that similar to "Hangman". Enjoy :) .The name of the game is “WordWar”.WordWar is run via Bluetooth. There are 2 players in a game, and their roles are equal. Player A chooses a word from a dictionary, and Player B tries to guess the word by suggesting letters (one letter at a time) or a whole word. The word to guess is represented by a row of dashes, giving the number of letters. If Player B suggests a letter which occurs in the word, the letter will appear in all its positions in the word; otherwise he/she loses a chance. The total chances for Player B is twice as many as the letters in the word. Player A also tries to guess the word chosen by Player B with the same condition. The game is over when: One player completes the word, or guesses the whole word correctly (He/She wins). One player fails too many times (The other player wins).
Slide 4
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Project Description (2)
A B “door” _ _ _ _ 8 “door” _ o o _ 8 “o” “door” _ o o _ 7 “c” “door” d o o _ 7 “d” “door” d o o r 7 “r”
Win! But d o o _ 0 “z”
Lose
Slide 5
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Project Description (3)
We have done the following four extra tasks: “The mobile application has to be enabled for download from
your project-web-site, ie OTA. “ “The application has to run seamlessly on a variety of
devices. ““Your project-web-site uses WURFL for content-adaption.” “You describe your mobile application/service with a FlashLite manual or a Flash Lite demo.”We have tested the Game successfully in the following of device:Nokia N93Nokia N95T-Mobile SDASony Ericsson W900iSony Ericsson Z750i You can download our game in the following link:http://people.dsv.su.se/~xiaowu/ProjectWebsite/Links.phpYou can visit our project via our project website:http://people.dsv.su.se/~xiaowu/ProjectWebsite/Index.php
Slide 6
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Project Description (4)
Nokia N95
Slide 7
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Project Description (5)
Nokia N95
Slide 8
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Project Description (6)
Sony Ericsson Z750i
Slide 9
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Project Description (7)
Sony Ericsson Z750i
Slide 10
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Game Functionality Description using Flash Demo
We have used Adobe Flash to create a Flash Demo for our game.It is based Flash Lite 2.0 and Action Script 2.0.You can watch the demo via the following link:
http://people.dsv.su.se/~xiaowu/ProjectWebsite/Demo.phpNow Let my group members use the Flash Demo to demonstrate our game!
Slide 11
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Game Design Description
Slide 12
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Game Design Description (2)
WordWar consists of 5 Java classes: BTClient, BTServer, GameStatus, GameCommunicator and WordWarGUI. BTClient and BTServer are responsible for bluetooth discovery and connection setup. Generally, peer-to-peer bluetooth communication will require one mobile phone act as server and the other as client; but we decide to make WordWar "purelly peer-to-peer": each WordWar application will start both Client and Server session, it not only tries to discover other players but also makes itself discoverable. Therefore, if several mobile users want to play WordWar, they don't need to negotiate or let someone start WordWar server volunteerly, they can simply run WordWar and search all players nearby. This design makes WordWar much more convenient to play.
Slide 13
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Game Design Description (3)
GameStatus is a helper class used to record players' game status. GameCommunicator is used for peer-to-peer communication and game logic handling. Several protocl messages (START_MESSAGE, QUIT_MESSAGE, WIN_MESSAGE, etc) are defined to control game progress. At the beginning of each round of the game, each player will select a challenge word for his/her opponent, this word will be checked against the dictionary file included in WordWar.jar, and make sure it is not a randomly makeup. The opponent will receive the challenge word as a row of dashes, for example: if Player A choose the word "mobile", then it will appear as "------" to Player B. Some words are rather complex while some others may be easy to guess, to make the game fair and more fun, we decide that each player will allow twice as many guesses as the letters in the word. In the example above, Player B will have 12 chances to complete the word. The first player finishes his/her challenge word wins, and the first player used all his/her chances loses. At the end of each round, players can choose whether to continue play next round or quit.
Slide 14
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Game Design Description (4)
WordWarGUI is the main class that controls the GUI and game progress, it is also responsible to handle all the failures and exceptions. Because all the communication classes (GameCommunicator, BTClient and BTServer) run in separate threads, WordWarGUI will not block during transmission, it always responds to user immediately. In each bluetooth neighbor discovery, WordWarGUI will start a timer for 25 seconds, and display a progress bar to inform the searching progress. If no neighbors are found within the timeout, WordWarGUI will cancel the searching thread automatically, avoide making user impatient. Users are allowed to configure their player names, which will be seen by other players in the game and neighbor discovery. WordWarGUI will inform the status (challenge word, remaining guesses) of player and his/her opponent during the game, and total score at the end of the game.
Slide 15
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
Design Web Site Design Description (2)
Slide 17
By Sun GangBy Sun Gang
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications
References
Tera-WURFL Libraryhttp://wurfl.sourceforge.net/utilities/terawurfl.php, Last Visited – March 2008PHP http://www.php.net/ ,Last Visited – March 2008Hangmanhttp://en.wikipedia.org/wiki/Hangman_(game), last visted – March 2008
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications By Sun GangBy Sun Gang
Questions ???
Royal Institute of Technology (KTH)Royal Institute of Technology (KTH)
ID 2216 – Developing Mobile ApplicationsID 2216 – Developing Mobile Applications By Sun GangBy Sun Gang