Example #1
0
        //        1. List<pos + DateTime (class)> // högre och högre tid på olika pos
        //        2. bild i ps, rita cirklar dra streck mellan dom..
        //        3. bygga på med vinklar (sist, till att börja med kör vi med position)
        public override void Initialize(GameContext context)
        {
            base.Initialize(context);

            snapShots = new List<Snapshot>();
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(0), new Vector2(487.0f, 585.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(3), new Vector2(510.0f, 200.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(7), new Vector2(775.0f, 326.0f)));
            snapShots.Add(new Snapshot(TimeSpan.FromSeconds(10), new Vector2(1142.0f, 103.0f)));

            this.spriteBatch = spriteBatch ?? new SpriteBatch(Context.Graphics.Device);

            time = "";
            interpolate = new Vector2();

            gameServer = ServiceLocator.Get<IGameServer>();
            gameClient = ServiceLocator.Get<IGameClient>();
            messageHandler = ServiceLocator.Get<IMessageHandler>();

            // Create the connection between the client and server
            gameServer.Start();
            gameClient.Connect();

            //sendTimer = new GameTimer(TimeSpan.FromMilliseconds(1000 / 20), SendClientSpatial);

            Context.Input.Keyboard.ClearMappings();
            Context.Input.Keyboard.AddMapping(Keys.F1);
            Context.Input.Keyboard.AddMapping(Keys.F2);
            Context.Input.Keyboard.AddMapping(Keys.F3);
        }
Example #2
0
        public override void Initialize(GameContext context)
        {
            base.Initialize(context);

            stringBuilder = new StringBuilder(100, 500);

            gameServer = ServiceLocator.Get<IGameServer>();
            gameClient = ServiceLocator.Get<IGameClient>();

            // Create the connection between the client and server
            gameServer.Start();
            gameClient.Connect();

            startedLoading = false;
            hasRenderedContent = false;
        }