j2me bluetooth games need help

hi all,

i m new to j2me. and my college project requirea project to develop a bluetooth multiplayer game using j2me.
it is difficult forme to get started, as there is not much references in internet.
all i found is all not for a beginner.

i study lots of j2me game codes, that gives me brief idea on how to develop a single player game.however, i need a multiplayer references. I know that some “mirror program” is needed. thats all i can get. i’ve been research for last 24 hours , but can;t get much. appreciate if anyone can help…??? plz…

If it were me, I’d start by writing a multiperson chat program. You can then create a game that runs over the top of the chat communication protocol. Turn based games are easiest because you don’t have to worry about the two game states getting out of step, as would be the case with real time games. If you choose a simple two player game, e.g. draughts (checkers), you could broadcast each move as the player makes it, so that it appears on both boards.

I would give more specific help with the bluetooth, only I also lack suitable experience :-\

thanks allan for the suggetion…but the lecturer is asking for an action game… :’( :’(
im currently starting to draw the pixel art and writing the codes for the menu list.
but there is no clue on how to start developing a network (bluetooth gane)…

anyone else can provide me some clue,…?

Not exactly a clue, but some links:
http://www.benhui.net/modules.php?name=Bluetooth
http://www.nokia.com/search3/search.jsp?wsid=005

shmoove

you need to discover the other bluetooth devices (the slow bit)- when u have there addresses you
can connect to them- make one of the phones the host- then the others will join the host. its not that
tricky really. and yes theres not much info on this… best thing u can do is download the SonyEricsson
SDK for java (even if u have a nokia) there is a set of demos that shows u how to make a bluetooth
2 player game…

if u want to connect your phone to a PC u will need a bluetooth stack on the PC. This can be hassle
because they cost money (if u want one that works). but when u have a java bt stack its pritty much
the same as u would connect to the phone.

so you need to (on the host phone):

  1. extend a DiscoveryListener.
  2. make a LocalDevice localDevice = LocalDevice.getLocalDevice();
  3. make your DiscoveryAgent agent = localDevice.getDiscoveryAgent();
  4. next step is to start to discover devices: agent.startInquiry(DiscoveryAgent.GIAC, this);
  5. if u have extended the DiscoveryListener all its methords will start to get called.
  6. store the devices into a Vector (or whatever u like).
  7. look up the services that are avalible on the device use the UUID of:
    UUID[] uuidSet = {new UUID(0x0003)};
  8. start a search: agent.searchServices(null, uuidSet, btDevice, this);
  9. when your client finds another phone with the service u want to comm over your ready :slight_smile:

so the server (host):

  1. start a bluetooth server (bit like a serversocket but using bt).

pritty simple the server. but that should get u up and running… worked cool for me… oh and when u want
to connect and chat to the host just connect like this:

String url = serviceRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
conn = (StreamConnection) Connector.open(url);
output = conn.openOutputStream();
ps = new PrintStream(output);

hope that helps?

er..i currently working on multiplayer game with bluetooth also..but it;s turn based...hehe...some how i can connect to each devices by bluetooth...but now stuck in extra game information n put it into packet..hehe...sorry cant help