Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 Wu Xiao 11th March 2008

2 Slide 2 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications Outline Project Introduction Game Functionality Description using Flash Demo Game Design Description Game Website Design Description References

3 Slide 3 By Sun Gang Royal Institute of Technology (KTH) ID 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”.Hangman 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).

4 Slide 4 By Sun Gang Royal Institute of Technology (KTH) ID 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

5 Slide 5 By Sun Gang Royal Institute of Technology (KTH) ID 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 N93 Nokia N95 T-Mobile SDA Sony Ericsson W900i Sony Ericsson Z750i You can download our game in the following link: http://people.dsv.su.se/~xiaowu/ProjectWebsite/Links.php You can visit our project via our project website: http://people.dsv.su.se/~xiaowu/ProjectWebsite/Index.php

6 Slide 6 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications Project Description (4) Nokia N95

7 Slide 7 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications Project Description (5) Nokia N95

8 Slide 8 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications Project Description (6) Sony Ericsson Z750i

9 Slide 9 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications Project Description (7) Sony Ericsson Z750i

10 Slide 10 By Sun Gang Royal Institute of Technology (KTH) ID 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.p hp Now Let my group members use the Flash Demo to demonstrate our game!

11 Slide 11 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications Game Design Description

12 Slide 12 By Sun Gang Royal Institute of Technology (KTH) ID 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.

13 Slide 13 By Sun Gang Royal Institute of Technology (KTH) ID 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.

14 Slide 14 By Sun Gang Royal Institute of Technology (KTH) ID 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.

15 Slide 15 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications Design Web Site Design Description Aim: content-adaption WURFL WURFL PHP Library wurfl_parser.php wurfl_class.php wurfl_config.php GetDeviceCapabilitiesFromAgent($_SERVER["HTTP_US ER_AGENT"]) getDeviceCapability('is_wireless_device')) getDeviceCapability('resolution_height') getDeviceCapability('resolution_width') Web-site with WURFL

16 Slide 16 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications Design Web Site Design Description (2)

17 Slide 17 By Sun Gang Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications References Tera-WURFL Library http://wurfl.sourceforge.net/utilities/terawurfl.phphttp://wurfl.sourceforge.net/utilities/terawurfl.php, Last Visited – March 2008 PHP http://www.php.net/ http://www.php.net/,Last Visited – March 2008 Hangman http://en.wikipedia.org/wiki/Hangman_(game)http://en.wikipedia.org/wiki/Hangman_(game), last visted – March 2008

18 Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications By Sun Gang Questions ???

19 Royal Institute of Technology (KTH) ID 2216 – Developing Mobile Applications By Sun Gang Thank You


Download ppt "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."

Similar presentations


Ads by Google