Ejemplo n.º 1
0
    void OnMouseDown()
    {
        //this tappedRedArrowCounter is for the tutorial
        tapRedArrowCounter++;
        activeMainPlayerOBJ    = GameObject.FindGameObjectWithTag("ActiveMain");
        activeMainPlayerScript = activeMainPlayerOBJ.GetComponent <MainChar>();
        QueueScript1 qScript = activeMainPlayerOBJ.GetComponentInChildren <QueueScript1>();

        if (qScript.myItemObjects.Count > 0)
        {
            activeMainPlayerScript.setMainTarget(activeMainPlayerScript.getTargetUnderConsideration());
            activeMainPlayerScript.getTargetUnderConsideration().setAssailant(activeMainPlayerScript);
            activeMainPlayerScript.setAttacking(true);
            activeMainPlayerScript.myArrow.SetActive(false);
            //uncomment the code below to hide all character queues when character first starts moving

            /*activeMainPlayerScript.myQueueOBJ.SetActive(false);
             * foreach(Character chr in levelManScript.charsInLevel){
             *      chr.myQueueOBJ.SetActive(false);
             * }*/
            levelManScript.setGameState(GAME_STATE.CHAIN_REACTION);
            levelManScript.enableAllInventoryColliders(false);

            //
        }
    }
Ejemplo n.º 2
0
    void Start()

    {
        instace = this;
        dashT   = dashDur + 1;
        tmpSpd  = spd;
    }
 void Start()
 {
     story = FindObjectOfType <InkStory>();
     mode  = GameMode.dialogue;
     main  = FindObjectOfType <MainChar>();
     gs    = FindObjectOfType <GameState>();
     main.SetAcceleration(2.0f, MainChar.movement.go);
 }
Ejemplo n.º 4
0
	public bool OnMouseDown(){
		if (levelManScript.getGameState() == GAME_STATE.NONE) {
			myQueueOBJ.SetActive (true);
		} else if (levelManScript.getGameState() == GAME_STATE.RED_ARROW_OUT) {
			activeMainPlayerOBJ = GameObject.FindGameObjectWithTag ("ActiveMain");
			activeMainPlayerScript = activeMainPlayerOBJ.GetComponent <MainChar>();
			activeMainPlayerScript.rotateArrow (this);
			activeMainPlayerScript.setTargetUnderConsideration(this);
		}
		return true;
	}
Ejemplo n.º 5
0
    public float dashC;    //Cooldown para volver a dashear

    void Start()
    {
        isUp = false;
        //transform.position = Save.lastCheckPoint;
        instace                  = this;
        anim                     = this.GetComponent <Animator>();
        rb                       = this.GetComponent <Rigidbody2D>();
        rb.constraints           = RigidbodyConstraints2D.FreezeRotation;
        transform.gameObject.tag = "detectable"; //Importante que el tag sea detectable para que los monstruos sigan a Lucy
        vel                      = velocidad;
        dashT                    = dashDur + 1;
    }
Ejemplo n.º 6
0
    private void ChooseStartingLocation()
    {
        Vector2 pos         = MainHatch.transform.position;
        float   randomAngle = UnityEngine.Random.value * Mathf.PI * 2f;
        Vector2 randomPos   = new Vector2(Mathf.Sin(randomAngle), Mathf.Cos(randomAngle));

        randomPos *= UnityEngine.Random.value * 50f + 100f;
        if (MainChar != null)
        {
            MainChar.Teleport(pos + randomPos);
        }
    }
Ejemplo n.º 7
0
 public Game(MainChar m)
 {
     pm        = new PhysicsManager(this);
     renderman = new RenderManager();
     entities  = //new AdvancedEntityManager(128,64,32,16,8,4,2,1,0.5);
                 new AdvancedEntityManager(pm, renderman, 128, 64, 32, 16, 8, 4, 2, 1, 0.5);
     events   = new GameEventManager(this, 1000, 100, 10, 1);
     mainChar = m;
     //entities = new ListEntityManager();
     gameTimer    = new BulletHell.Time.Timer();
     curTimeRate  = 1;
     timeRateFunc = new PolyFunc <double, double>(curTimeRate);
     timeFunc     = timeRateFunc.FI;
     Add(m);
 }
Ejemplo n.º 8
0
 public bool OnMouseDown()
 {
     if (levelManScript.getGameState() == GAME_STATE.NONE)
     {
         myQueueOBJ.SetActive(true);
     }
     else if (levelManScript.getGameState() == GAME_STATE.RED_ARROW_OUT)
     {
         activeMainPlayerOBJ    = GameObject.FindGameObjectWithTag("ActiveMain");
         activeMainPlayerScript = activeMainPlayerOBJ.GetComponent <MainChar>();
         activeMainPlayerScript.rotateArrow(this);
         activeMainPlayerScript.setTargetUnderConsideration(this);
     }
     return(true);
 }
    //主角
    void CreateMainChar()
    {
        GameObject mainCharObj = new GameObject();

        mainCharObj.name               = "@MainChar";
        mainCharObj.transform.parent   = this.transform;
        mainCharObj.transform.position = birthPosTran.position;
        mainCharObj.transform.rotation = Quaternion.identity;

        CharacterController charController = mainCharObj.AddComponent <CharacterController> ();

        charController.radius     = 0.35f;
        charController.height     = 1.65f;
        charController.skinWidth  = 0.01f;
        charController.slopeLimit = 20.0f;
        charController.center     = new Vector3(0, 0.825f, 0);

        mainChar = mainCharObj.AddComponent <MainChar> ();
    }
Ejemplo n.º 10
0
    public void load()
    {
        story = FindObjectOfType <InkStory>();
        mode  = GameMode.dialogue;
        main  = FindObjectOfType <MainChar>();
        Debug.Log(main.maxSpeed);
        Vector3 pos = gs.loadPosition(type);

        if (pos != new Vector3(0f, 0f))
        {
            Debug.Log("Loaded:");
            Debug.Log(pos);
            main.transform.position = pos;
            Debug.Log(main.maxSpeed);
        }
        if (!story.CanContinue())
        {
            Debug.Log(!story.CanContinue());
            ContinueTraveling();
        }
    }
Ejemplo n.º 11
0
	void OnMouseDown(){
		//this tappedRedArrowCounter is for the tutorial
		tapRedArrowCounter++;
		activeMainPlayerOBJ = GameObject.FindGameObjectWithTag ("ActiveMain");
		activeMainPlayerScript = activeMainPlayerOBJ.GetComponent <MainChar>();
		QueueScript1 qScript = activeMainPlayerOBJ.GetComponentInChildren<QueueScript1>();
		if(qScript.myItemObjects.Count > 0){
			activeMainPlayerScript.setMainTarget (activeMainPlayerScript.getTargetUnderConsideration());
			activeMainPlayerScript.getTargetUnderConsideration().setAssailant(activeMainPlayerScript);
			activeMainPlayerScript.setAttacking(true);
			activeMainPlayerScript.myArrow.SetActive(false);
			//uncomment the code below to hide all character queues when character first starts moving
			/*activeMainPlayerScript.myQueueOBJ.SetActive(false);
			foreach(Character chr in levelManScript.charsInLevel){
				chr.myQueueOBJ.SetActive(false);
			}*/
			levelManScript.setGameState(GAME_STATE.CHAIN_REACTION);
			levelManScript.enableAllInventoryColliders(false);

			//

		}
	}
Ejemplo n.º 12
0
 public void TakeItem(Item.Type type, int amount) => MainChar.TakeItem(type, amount);