Original address link
This example is associated with the example of "racing game (ii)" and enables human-computer interaction through Bluetooth.
Download source code
To run this app, you need two bluetooth terminal phones (for example, Sony Ericsson k750) and connect them before starting the app. Once communication is established, the 3D world will start and each player will see two racing cars: himself and his opponent. In the 3D world, each player can use a cell phone soft key to manipulate his own racing car.
Bluetooth is a part of the application and consists of servers or clients. Players choose one of them.
When you move your car, the latest position and rotation coordinate data will be sent to other players, so your position can be correctly displayed on the opponent's screen.
Players can control the movement of cars, but this is limited. When a contestant moves the racing car, the camera will move in the same way. The racing car can move like this:
L arrows rotate left/right: left/right
L up/down the Arrow: Move the front/back
L key 4/6: Move left/right
L fire key: camera follows racing car
In commercial applications, using hardware to connect URLs to other mobile phones may lead to faster Bluetooth connections. Once connected, you can obtain the URL, so it will be faster when connected again.
Source: http://www.j2medev.com/Article/ShowArticle.asp? ArticleID = 1104 Author: numenzq