Exemple #1
0
 public void revcMsgFromGameManager(Pika.Game.Control sendmsg)
 {
     byte [] buf;
     using(var ms = new MemoryStream())
     {
         Serializer.Serialize<Pika.Game.Control>(ms, sendmsg);
         buf = ms.ToArray();
         sendmsg = null;
     }
     q.Enqueue(buf);
     network_bytes += buf.Length;
     //sock.SendTo(buf, ep);
 }
Exemple #2
0
 public MotionType GetPlayerMotionType(Pika.Game.Control.MotionType mt)
 {
     if(mt == Pika.Game.Control.MotionType.WALK)
         return MotionType.WALK;
     else if(mt == Pika.Game.Control.MotionType.JUMP)
         return MotionType.JUMP;
     else if(mt == Pika.Game.Control.MotionType.SLIDE)
         return MotionType.SLIDE;
     else if(mt == Pika.Game.Control.MotionType.SPIKE)
         return MotionType.SPIKE;
     else if(mt == Pika.Game.Control.MotionType.WIN)
         return MotionType.WIN;
     else
         return MotionType.LOSE;
 }
Exemple #3
0
    public void GetP2Info(Pika.Game.Control msg)
    {
        rcvMsg = msg;
        if(msg.time >= receiveTime)
        {
            receiveTime = msg.time;
        }

        else
        {
            return;
        }

        SetP2Moving();
    }