0

I am trying to make a multiplayer game where you move your robot and play a game. I cannot get the robots to move though. I mean like if i move a robot on one device it won't move on the other device so, I know it have to send the position of that moving object to the other device. I just do not know how to do that.

Does anyone have any good tutorials or know the code to send the position of an image to another device over bluetooth?

I am using the Gamekit on xcode for the bluetooth. (peerpickercontroller)

I am sorry if this sounds awkward but I tried to word it the best I could.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Derrick Mu
  • 68
  • 9
  • 2
    If you're using GameKit, you have to send the data via GKMatch. Check out this answer: http://stackoverflow.com/a/4574833/2274694 – Lyndsey Scott Dec 07 '14 at 05:05
  • Could you possibly find one with sending positions because the one u sent is to send the score not the position? – Derrick Mu Dec 07 '14 at 06:58

1 Answers1

0

Assuming you already have the bluetooth framework implemented and the devices successfully talking to each, you can put the coordinates of the imageView's frame in the bluetooth packet that's received by the other device. When the other device receives the packet, read the coordinates and update it's imageView's frame to what you sent over

Chris
  • 7,270
  • 19
  • 66
  • 110
  • Well I have the Bluetooth stuff set up but how do I send the packet to the other device with the packet. If u know the codei would appreciate it greatly – Derrick Mu Dec 07 '14 at 04:27