Pong like game

Hi there,

I'm trying to make a simple Pong game.

Currently what I have is a lobby where players can create and join a room.

The room they join is a room that lets them chat together, and then when the room has two players, I want it to load the playing room where they play pong etc.

How do I create the players on either side of court, at the same time and have the game begin?

Thanks.

Comments

  • You could send an RPC to start to All.
    The PhotonNetwork.time is a synced server timestamp. You could use that, too.
  • How do you go about that?

    [code2=csharp]this.photonView.RPC("Load", PhotonTargets.All );


    [RPC]
    public void Load()
    {
    PhotonNetwork.LoadLevel( "_Game" );
    }[/code2]

    This works, and loads the room.

    I have also created a player using PhotonNetwork.Instantiate. This creates two players as there are two people in the game room.
    How do I make it so the players are created on opposite sides of the field? Currently they are both spawned in the same position.

    The game also spawns the ball in the same way as above ^. However this spawns two balls instead of just one. How would I just create one?

    Is there a way to have an object that is shared between users running the game? Like the two users playing against each other, is there a way to have a SHARED game controller between them?
  • I think you need to work through the Marco Polo Tutorial and then deduct a bit from that or play around with the values we use in there. Positioning of the avatars or paddles is not really hard. You will find a solution :)
    http://doc.exitgames.com/photon-cloud/M ... o_Tutorial

    You can't share a PhotonView with multiple users, so you won't be able to use that really. However, you can use one PhotonView on a scene game object to call RPCs on it, moving a ball around. Like: When the ball collided with my paddle, send RPC "paddle hit at pos X, moving in direction Y" or so.