
I have just found another very cool multiplayer game which makes use of the accelerometer of the N95 and N95 8GB and N82.
Inspired by the popular “LightSaber”, Phone Fight is a prototype sword-fighting game for two players equipped with Nokia N95 or compatible phones. It makes use of the accelerometer within the phones to detect simulated sword slashes and blocks, and Bluetooth to communicate those moves between the phones and to notify the winning player of victory.
It was conceived and coded (hacked) in about twelve hours by a team from lastminute.com labs over the course of the Over the Air event held at Imperial College in London on April 4th-5th 2008.
The game is written in the popular programming language Python.
A very cool idea to develop a game which uses the accelerometer also for a multiplayer game by expanding the already known concept of the succesful “LightSaber” application. Unfortunately I don’t have a friend with an N95 with whom I could play the game…
Have a look how the game works, it looks so funny:
Have a look here to view the original video in higher resolution.
The game is still an early alpha version, so it’s not that easy to install the game. But by following the instructions below, you should soon be able to fight against your friends.
Prerequisites
Each participating N95, N95 8GB or N82 phone requires:
- The N95 Accelerometer plugin from
http://research.nokia.com/files/N95_RD_Accelerometer.zip
- Python for S60 v1.4.2 or newer: see http://sourceforge.net/projects/pys60
- Cyke64’s axyz Python extension from: http://sourceforge.net/project/showfiles.php?group_id=132176&package_id=252008
(install the newest self-signed version)
Install all the files ahead as usual on your phone.
Installation
First download the archive containing the “Phone Fight” script, sounds and further help files at the end of the article.
For each participating phone:


- Make a directory on your phone’s external memory drive called e:\sounds\phonefight and copy everything from the sounds directory into there.
The “e:\sounds” directory may be displayed as ‘Sound Clips’ on your phone. Don’t worry about that. Just make a phonefight subdirectory in there.
- (This step is only necessary if socket.bt_discover() fails to work. Skip it to begin with.) Edit python/fight.py to alter the value of the PHONES variable such that it contains the names of the participating phones and their corresponding bluetooth addresses. You can choose what string you like for the phone name


- Copy “python/fight.py” to “e:\python” or “c:\python” on the phone
Setup


Each player should start the fight.py script from the Python shell’s ‘Run Script’ menu option.


One player should select ‘I am the Champion’ from the menu that appears. This make his or her phone the ’server’. A message will appear saying ‘waiting for client on channel 5…’ (or possibly some other number).


The other player should select ‘I am the Challenger’. He or she will be then prompted with ‘Discover automatically?’. He or she should then answer ‘yes’ and a a list of nearby bluetooth-enabled phones will appear*. The other player should select the champion’s phone from this list.
If setup is successful, a sword ‘unsheathing’ sound effect will be heard on both phones, and both players can commence combat.
* NOTE that the Python interpreter may crash at this point. This
probably means that the socket.bt_discover() call is faulty. To remedy
this, alter the script as described in “Install” ahead, then rerun the script
and answer ‘no’ to the question ‘Discover automatically’. If prompted
for a channel, enter the number displayed on the champion’s phone.

Combat
A vertical attack is successfully defended by a horizontal block and vice versa.
To execute a vertical attack:
Start with the phone screen facing you in a vertical (i.e. portrait) position. Move the phone rapidly downward and away from you.
To execute a horizontal attack:
Start with the phone screen facing you pointing to the left or right, it doesn’t matter which (i.e. landscape). Move the phone rapidly away and to the side.
To block:
Hold your phone vertically or horizontally, as appropriate, with the screen facing you. Note that holding the phone upside-down is *not* a valid block.
In either form of attack, a sword ’swhoosh’ sound should be heard. If your attack is successful (i.e. not blocked), your opponent’s phone will play an ‘urrgh’ sound effect and he or she will lose of his or her 10 health points. Otherwise, a ‘ching’ sound effect will be heard.
When one player has no health left, the game is over.
The object of the game is to deliver ten successful blows to your
opponent before he or she can do the same.
Playing again
At the end of the game, each player will be told the result and prompted to play again. Each player must give the same answer, or the game will crash!
Practice Mode

Selecting ‘I need practice’ from the first menu will initiate a practice mode, where you can swoosh your virtual sword to your heart’s content. No other phone is necessary in this mode.

And a few further information from the developers:
Gameplay inadequacies:
- The program knows about re-orientation of the phone a short while after it happens, leading to unexpectedly (un)successful attacks.
- Each player is essentially defending all the time (either horizontally or vertically).
- The application is not very pretty to look at.
- This isn’t really a very good simulation of a sword fight. It’s still fun, though.
Potential improvements:
As well as fixing the above, the following are areas which could be improved:
- Add new sound effects for new types of sword (wooden sword, photon sword…)
- Add a graphical element to the game (perhaps a health bar)
- Incorporate GPS, camera and network functionality…
Sounds great and I am eagerly to try this game out! All of you who have friends with accelerometer supporting phones, just try to follow the steps, it’s not as hard as it looks like. And if it is, the fun you will have to play this game should be always worthwhile!
You can download “Phone Fight” here.
Developer Page: Lastminute Labs
May 1, 2008 at 3:58 am |
[...] de surgirem jogos em que você pode voar e coletar moedas voadoras ou convidar seus amigos para uma luta virtual, agora é possível usar seu celular para acelerar e controlar carrinhos de brinquedo com o simples [...]
October 12, 2008 at 7:17 pm |
i cant get it to work so can some one tell how as it looks good
October 14, 2008 at 8:22 pm |
Huge thanks dude.. it works perfectly now
February 5, 2009 at 4:37 pm |
An installable version has now been released. Check out the project homepage at labs.lastminute.com/phonefight/