Ejemplo n.º 1
0
        private void MainLoop(object sender, ElapsedEventArgs e)
        {
            // MOVING
            Player.MoveHero();
            if (_npcTime)
            {
                InvokeNPCs();
            }


            // INVOKING BULLETS
            InvokeBullets();


            // SHOOTING
            if (_npcTime)
            {
                InvokeNPCs(shoot: true);
            }
            Player.Shoot();


            // RENDERING THE MAP
            _npcTime = !_npcTime;
            FieldViewer.GetInstance().Render();


            // CHECK IF THE GAME IS OVER
            if (NPCs.Count == 0 || GameState.Died())
            {
                GameState.Win();
                StopTheGame();
            }
        }
Ejemplo n.º 2
0
    private void Awake()
    {
        m_fieldController = GetComponent <FieldController>();
        m_fieldViewer     = GetComponent <FieldViewer>();

        m_backgroundsParent = Instantiate(m_backgroundsParent);
        m_backgroundsParent.transform.SetParent(transform);
    }
Ejemplo n.º 3
0
 public override void OnLeftClickDown()
 {
     if (card.container == card.controller.hand && !is_targeting)
     {
         field_viewer    = card.controller.field.GetComponent <FieldViewer>();
         hand_viewer     = card.controller.hand.GetComponent <HandViewer>();
         attach_to_mouse = StartCoroutine(AttachToMouse());
     }
 }
Ejemplo n.º 4
0
        private void MenuItem_Click_4(object sender, RoutedEventArgs e)
        {
            FieldViewer viewer = new FieldViewer(new Campo()
            {
                nombre      = "campo " + items,
                descripcion = "descripcion",
                id          = items,
                tipo        = Campo.TiposDeCampo.OpcionesExclusivas
            });

            fields.Children.Add(viewer);
            viewer.Focus();
            items++;
        }
Ejemplo n.º 5
0
        private void MenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            FieldViewer viewer = new FieldViewer(new Campo()
            {
                nombre      = "campo " + items,
                descripcion = "descripcion",
                id          = items,
                tipo        = Campo.TiposDeCampo.Texto
            });

            fields.Children.Add(viewer);
            viewer.Focus();
            items++;
            saved = false;
        }
Ejemplo n.º 6
0
        private void MainLoop()
        {
            while (!GameOver)
            {
                // IF THE OPPONENT IS NOT ONLINE
                if (!CheckOpponentOnline())
                {
                    StopTheGame();
                    break;
                }


                // MOVING
                Communicate(SocketCommunication.ReceiveMove);
                Opponent.MoveHero();

                Communicate(SocketCommunication.SendMove,
                            Player.MoveHero());

                if (_npcTime)
                {
                    InvokeNPCs();
                }

                // INVOKING BULLETS
                InvokeBullets();

                // SHOOTING
                if (_npcTime)
                {
                    InvokeNPCs(shoot: true);
                }

                Communicate(SocketCommunication.ReceiveShoot);
                Opponent.Shoot();

                Communicate(SocketCommunication.SendShoot,
                            Player.Shoot());


                // RENDERING THE MAP
                _npcTime = !_npcTime;
                FieldViewer.GetInstance().Render();
            }
        }
Ejemplo n.º 7
0
        private void MainLoop(object sender, ElapsedEventArgs e)
        {
            // IF THE OPPONENT IS NOT ONLINE
            if (!CheckOpponentOnline())
            {
                StopTheGame();
                return;
            }

            // MOVING
            Communicate(SocketCommunication.SendMove,
                        Player.MoveHero());

            Communicate(SocketCommunication.ReceiveMove);
            Opponent.MoveHero();

            if (_npcTime)
            {
                InvokeNPCs(shoot: false);
            }

            // INVOKING BULLETS
            InvokeBullets();

            // SHOOTING
            if (_npcTime)
            {
                InvokeNPCs(shoot: true);
            }

            Communicate(SocketCommunication.SendShoot,
                        Player.Shoot());

            Communicate(SocketCommunication.ReceiveShoot);
            Opponent.Shoot();


            // RENDERING THE MAP
            _npcTime = !_npcTime;
            FieldViewer.GetInstance().Render();

            // RESTARTING THE TIMER
            GameTimer.StartTimer();
        }
 private void Awake()
 {
     m_fieldController = GetComponent <FieldController>();
     m_fieldViewer     = GetComponent <FieldViewer>();
     m_audio           = GetComponent <FieldAudio>();
 }