Esempio n. 1
0
 private void OnServerWelcome(int id)
 {
     _currentId = id;
     _pewzor    = _stuffFactory.CreatePewCircle(
         new PewCircleSettings
     {
         Id         = _currentId,
         Name       = "X" + id,
         SpawnPoint = new PointF(100, 100)
     }, true);
     lock (objectsSynchro)
     {
         _objects.Add(_pewzor);
     }
 }
Esempio n. 2
0
        internal void GoGoLazer(PewCircle pewCircle)
        {
            PointF mouse = _inputManager.GetMousePosition().ToPointF();

            int         newId = Interlocked.Increment(ref _currentId);
            LazerPewPew lazer = _stuffFactory
                                .CreateLazer(new LazerPewPewSettings
            {
                Id         = newId,
                CreatorId  = pewCircle.Id,
                Direction  = mouse.Subtract(pewCircle.Physics.Center),
                SpawnPoint = pewCircle.Physics.GetDirectionAsPoint(15).Add(pewCircle.Physics.Center)
            });

            lock (objectsSynchro)
            {
                _objects.Add(lazer);
            }
        }