Example #1
0
	// Use this for initialization
	void Start () {
		rigidBody = GetComponent<Rigidbody2D> ();
		anim = GetComponent<Animator> ();

		mainController = (MainGameController) GameObject.FindObjectOfType (typeof(MainGameController));
		canJump = true;
	}
Example #2
0
    // Use this for initialization
    void Start()
    {
        // Retrieve the characterController
        character = GetComponent <CharacterController>();
        main      = Camera.main.GetComponent <MainGameController>();

        // inititialise the arrays used for manipulating the touch controls
        touchStartPosition = new Vector2[maxTouches];
        touchStartTime     = new float[maxTouches];
        touchState         = new InputState[maxTouches];

        #region GUI

        leftDragBtnStyle  = activeSkin.customStyles[0];
        rightDragBtnStyle = activeSkin.customStyles[0];

        float btnHeight = Screen.height * dragBtnScale;
        float btnWidth  = btnHeight * ((float)leftDragBtnStyle.normal.background.width /
                                       (float)leftDragBtnStyle.normal.background.height);
        float btnMargin = Screen.height * dragBtnMargin;

        float touchAreaWidth  = btnWidth * 2;
        float touchAreaHeight = btnHeight * 1.25f;

        leftDragBtnRect = new Rect(btnMargin, Screen.height - btnHeight - btnMargin,
                                   btnWidth, btnHeight);
        rightDragBtnRect = new Rect(Screen.width - btnWidth - btnMargin,
                                    Screen.height - btnHeight - btnMargin,
                                    btnWidth, btnHeight);
        leftTouchArea  = new Rect(0, 0, touchAreaWidth, touchAreaHeight);
        rightTouchArea = new Rect(Screen.width - touchAreaWidth, 0, touchAreaWidth, touchAreaHeight);

        #endregion
    }
Example #3
0
    string strStage = ""; //1-1みたいな

    // Use this for initialization
    void Start()
    {
        objMGController = objBoard.GetComponent <MainGameController>();

        ttsize   = ttData.GetLength(0);
        stageIdx = PuzzleMenuController.getStageIdx(); // ステージIDを取得
        setStage();
    }
Example #4
0
    /// <summary>
    /// Awake is used to initialize any variables or game state before the game starts.
    /// </summary>
    private void Awake()
    {
        // Create chunk queue
        InitializeChunks();

        // Set the game controller
        gameController = gameControllerObj.GetComponent <MainGameController>();
    }
    public virtual void StartMultiplayer()
    {
        MainGameController.ShowHud(true);
        UINavigationController.DismissAllControllers();
        UINavigationController.DismissBackground("/MainBackground");

        MainGameController.StartMultiplayerGame();
    }
Example #6
0
    /// <summary>
    /// Use this for initialization
    /// </summary>
    private void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        GameObject gameControllerObj = GameObject.FindGameObjectWithTag("GameController");

        gameController = gameControllerObj.GetComponent <MainGameController> ();
        audioSource    = gameObject.GetComponent <AudioSource> ();
    }
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            game = new MainGameController(ref blockTab, ref nextBlockTab, ref holdBlockTab, ref PlayerNick, ref Score, ref Combo, ref Record, ref DestroyedLines);

            KeyDown += GetKey;
            StartButton.IsEnabled = false;
            PlayerNick.IsEnabled  = false;
        }
 private void Awake()
 {
     CurrentHealth                  = MaxHealth;
     _uiController                  = FindObjectOfType <UIController>();
     _mainGameController            = FindObjectOfType <MainGameController>();
     ActiveEnemycontrollers         = new List <EnemyController>();
     ActiveThrowingEnemycontrollers = new List <ThrowingEnemyController>();
 }
    protected virtual void StartGame()
    {
        MainGameController.ShowHud(true);
        UINavigationController.DismissAllControllers();
        UINavigationController.DismissBackground("/MainBackground");

        MainGameController.StartLocalSinglePlayerGame();
    }
Example #10
0
	// Use this for initialization
	void Start () {
		obstacle = GetComponent<Obstacle> ();
		mainController = (MainGameController) GameObject.FindObjectOfType (typeof(MainGameController));
		values = 0;
		foreach (Switch sw in switches) {
			if (sw.value)
				values++;
		}
	}
Example #11
0
	// Use this for initialization
	void Start () {
		obstacle = GetComponent<Obstacle> ();
		mainController = (MainGameController) GameObject.FindObjectOfType (typeof(MainGameController));
		values = 0;
		foreach (WindowLvl1 window in windows) {
			if (window.isClosed)
				values++;
		}
	}
Example #12
0
    // Use this for initialization
    void Start()
    {
        Board            = GameObject.Find("Board");
        script           = Board.GetComponent <MainGameController>();
        gobjOGController = GameObject.Find("OnlineGameController");
        diceSizeHalf     = transform.localScale.x / 2f;

        sound_roll = GetComponent <AudioSource>();
    }
Example #13
0
        public void LoadKeysEmptyFileTest()
        {
            var view       = new Mock <IMainGameView>();
            var controller = new MainGameController(view.Object);

            controller.LoadKeysResources("");

            controller.Chars.Count.ShouldBe(0);
        }
Example #14
0
        public void SubscribeToEventsTest()
        {
            var view = new Mock <IMainGameView>();

            view.Setup(x => x.SubscribeGlobalEvents());
            var controller = new MainGameController(view.Object);

            view.VerifyAll();
        }
Example #15
0
    public void UpdatePlayerImage()
    {
        Vector2 pos = -_waypointPanel.transform.localPosition;

        pos.x = MainGameController.Map(pos.x, -8192, 8192, -250, 250);
        pos.y = MainGameController.Map(pos.y, -8192, 8192, -250, 250);
        _playerImage.transform.localPosition    = pos;
        _playerImage.transform.localEulerAngles = _boat.transform.localEulerAngles + _boatImageOffset;
    }
Example #16
0
        private void OnDisable()
        {
            MainGameController instance = MainGameController.Instance;

            if (instance == null)
            {
                return;
            }
            instance.DeregisterHighFixedTimestepBehavior(this);
        }
Example #17
0
    public void ShowQuestionsPanel(QuestionData.question q)
    {
        SetButtonEnabled(true);

        MainGameController.ShowHud(false);
        UINavigationController.PushBackground("/MainBackground");
        UINavigationController.PushController(questionDialog);

        PrepareQuestion(q);
    }
Example #18
0
        public void SupressTaskSwitchTest()
        {
            var view       = new Mock <IMainGameView>();
            var controller = new MainGameController(view.Object);

            controller.IsShouldSupressKey(Keys.Tab, true, true).ShouldBe(true);
            controller.IsShouldSupressKey(Keys.Tab, true, false).ShouldBe(true);
            controller.IsShouldSupressKey(Keys.Tab, false, true).ShouldBe(false);
            controller.IsShouldSupressKey(Keys.Tab, false, false).ShouldBe(false);
        }
Example #19
0
    // Use this for initialization
    void Start()
    {
        // Retrieve the characterController
        character = GetComponent <CharacterController>();
        main      = Camera.main.GetComponent <MainGameController>();

        // inititialise the arrays used for manipulating the touch controls
        touchStartPosition = new Vector2[maxTouches];
        touchStartTime     = new float[maxTouches];
        touchState         = new InputState[maxTouches];
    }
    void Start()
    {
        this.GetComponent <Rigidbody>().isKinematic = true;
        swing            = 1f;
        originalPosition = transform.position;
        //print("Orignial Position" + originalPosition.ToString());
        multi = Random.Range(1, 4);
        GameObject controllerObject = GameObject.Find("Main Game Controller");

        controller = controllerObject.GetComponent <MainGameController>();
    }
 void Awake()
 {
     if (current == null)
     {
         current = this;
     }
     else if (current != this)
     {
         Destroy(gameObject);
     }
 }
Example #22
0
    void Start()
    {
        GetComponent <FadeController>().FadeIn();
        truckInfos = MainGameController.getTruckInfos();

        int[] highScores = ScoreManager.GetData(SelectController.stageNum);
        highScore          = highScores[SelectController.getSelectStageNum()];
        highPriceText.text = highScore.ToString();

        confirmButton.interactable = false;
    }
Example #23
0
 public void UpdateOpponent()
 {
     for (int i = 0; i < _opponents.Count; i++)
     {
         GameObject opponent = _opponents[i];
         Vector2    pos      = opponent.transform.GetChild(0).localPosition;
         pos.x = MainGameController.Map(pos.x, -8192, 8192, -250, 250);
         pos.y = MainGameController.Map(pos.y, -8192, 8192, -250, 250);
         _opponentImages[i].transform.localPosition    = pos;
         _opponentImages[i].transform.localEulerAngles = opponent.transform.GetChild(0).localEulerAngles + _boatImageOffset;
     }
 }
    /// <summary>
    /// Awake is used to initialize any variables or game state before the game starts.
    /// </summary>
    private void Awake()
    {
        GameObject gameControllerObj = GameObject.FindGameObjectWithTag("GameController");

        gameController = gameControllerObj.GetComponent <MainGameController> ();

        // Get mine prefab and make it a child object
        GameObject minePrefab = Resources.Load <GameObject> ("Prefabs/Mine");

        mine = Instantiate(minePrefab, transform.position, transform.rotation);
        mine.transform.parent = transform;
    }
Example #25
0
 // Update is called once per frame
 void Update()
 {
     if (transform.position.y >= 10)
     {
         Destroy(this.gameObject);
         if (noBalon == 4)
         {
             MainGameController.GetInstance().kuisSelesai = true;
             MainGameController.GetInstance().TambahSkor(-10);
         }
     }
 }
 private void Awake()
 {
     BlockTransform             = GetComponent <Transform>();
     _gameField                 = FindObjectOfType <GameField>();
     _blockCollider             = GetComponent <Collider2D>();
     _healthPointsText          = gameObject.GetComponentInChildren <Text>();
     _blockSpriteRenderer       = GetComponent <SpriteRenderer>();
     _blockSpriteRenderer.color = HealthGradient.Evaluate(Mathf.Floor(HealthPoints) / 50);
     _gameController            = FindObjectOfType <MainGameController>();
     _destroyPosition           = new Vector2();
     DestroyParticle.Stop();
 }
    // Use this for initialization
    void Start()
    {
        GameObject controllerObject = GameObject.Find("Main Game Controller");

        controller = controllerObject.GetComponent <MainGameController>();
        hand       = side.GetComponent <JointPositioner>().JointToTrack.ToString();

        GameObject configObject = GameObject.Find("Game Settings");

        config         = configObject.GetComponent <GameConfig>();
        spinMultiplier = config.indicatorSpinSpeed;
    }
Example #28
0
        public void ProcessKeyTest()
        {
            var view = new Mock <IMainGameView>();

            view.Setup(x => x.PlaySound(It.IsAny <int>(), 100));

            var controller = new MainGameController(view.Object);

            controller.LoadKeysResources(TestKeyFileResource);

            controller.ProcessKey(Keys.R);
            view.VerifyAll();
        }
Example #29
0
    public void EnterTankField(MainGameController _mainController)
    {
        mainController = _mainController;
        gameStage      = GameStage.preparing;
        foreach (PhotonPlayer player in PhotonNetwork.playerList)
        {
            RegisterPlayer((int)player.CustomProperties["index"]);
        }

        ExitGames.Client.Photon.Hashtable sideNumHash = new ExitGames.Client.Photon.Hashtable();
        sideNumHash.Add("SideNum", PlayerNumEachSide);
        PhotonNetwork.room.SetCustomProperties(sideNumHash);
    }
    // Start is called before the first frame update
    void Start()
    {
        MainGameController.setIsFinish(false);

        nextButton.SetActive(false);
        priceText.SetActive(false);
        sentence.SetActive(false);
        price = MainGameController.getTotalPrice();
        Invoke("Appear", 0.40f);
        Invoke("Delete", 4.10f);

        oscController = GameObject.Find("OSCManager").GetComponent <OSCController>();
    }
Example #31
0
    // Use this for initialization
    void Start()
    {
        ttData[0, 2] += PlayerPrefs.GetString("userName") + "さん。";

        objBoard        = GameObject.Find("Board");
        objMGController = objBoard.GetComponent <MainGameController>();

        objTT           = GameObject.Find("TutorialText");
        objTTController = objTT.GetComponent <TutorialTextController>();

        maxDataIdx = ttData.GetLength(0);
        setNext();
    }
Example #32
0
    // Use this for initialization
    void Start()
    {
        playerSubFarmCount = 1;
        subFarms           = new GameObject[transform.childCount];
        uiController       = GameObject.FindObjectOfType <UIController>();
        mainGameController = GameObject.FindObjectOfType <MainGameController>();
        saveLoadController = GameObject.FindObjectOfType <SaveLoadController>();

        CheckSubFarmCount();

        currentActiveSubFarmIndex = 0;
        SetSubFarmActive(0);
    }
Example #33
0
        public void SupressRightMouseClickTest()
        {
            var view       = new Mock <IMainGameView>();
            var controller = new MainGameController(view.Object);

            controller.IsShouldSupressMouse(MouseButtons.Left).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.Middle).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.Right).ShouldBe(true);
            controller.IsShouldSupressMouse(MouseButtons.Middle).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.None).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.XButton1).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.XButton2).ShouldBe(false);
        }
	// Use this for initialization
	void Start (){
		anim = GetComponent<Animator> ();
		obstacle = GetComponent<Obstacle> ();
		mainController =(MainGameController)GameObject.FindObjectOfType (typeof(MainGameController));
		rotated = false;
	}
 public virtual void Awake()
 {
     mainGameController = this;
 }
Example #36
0
	// Use this for initialization
	void Start () {
		obstacle = GetComponent<Obstacle> ();
		mainController = (MainGameController) GameObject.FindObjectOfType (typeof(MainGameController));

	}