Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        //cash
        //transform cash
        cashTransform = transform;
        //sprite renderer
        sr = GetComponent <SpriteRenderer>();
        //maincontroller
        mainCtr = GameObject.Find("mainController");
        mc      = mainCtr.GetComponent <mainController> ();
        //map controller
        mpCtr = GameObject.Find("mapController");
        mpc   = mpCtr.GetComponent <mapController> ();

        //pos x,y (set from parent objects)
        cashTransform.position = new Vector3(posx, posy, 0.0f);

        //sprite init
        sr.sprite = spr;

        //system init
        intervalCnt = 0;

        //scroll speed
        speed_y = 0.0f;

        //scroll x move
        mpxmov = 0;

        //objnum inc
        mc.incObj();
    }
    public void checkDoors(TileController currentTile)
    {
        map = mapObject.GetComponent <mapController>();
        string tileName = currentTile.transform.name;

        if (currentTile.leftDoor)
        {
            map.moveLeft();
            //direction = "left";
            direction = getDirection(tileName);
            resetRoom();
            //tileName = currentTile.transform.name;
            //print("ENTERING LEFT DOORWAY");
        }
        if (currentTile.rightDoor)
        {
            map.moveRight();
            direction = getDirection(tileName);
            resetRoom();
            //print("ENTERING RIGHT DOORWAY");
        }
        if (currentTile.backDoor)
        {
            map.moveBack();
            //direction = "back";

            direction = getDirection(tileName);

            resetRoom();
            //print("ENTERING BACK DOORWAY");
        }
    }
Ejemplo n.º 3
0
 // Use this for initialization
 public tile(int x, int y, char type, mapController controller)
 {
     this.x          = x;
     this.y          = y;
     this.type       = type;
     this.controller = controller;
     if (!handleType())
     {
         Debug.Log("error setting type: " + type);
     }
 }
    public void setDoorways()
    {
        print("inside SetDoorways");

        GameObject    doorMapObject = GameObject.Find("mapObject");
        mapController doorMap       = mapObject.GetComponent <mapController>();

        Color defaultColor = new Color(1, 1, 1, 1);

        Renderer leftTileRenderer = leftDoorTileController.GetComponent <Renderer>();

        if (map.getLeftChild() != 0)
        {
            leftDoorTileController.leftDoor = true;
            leftTileRenderer.material.color = Color.green;
        }
        else
        {
            leftDoorTileController.leftDoor = false;
            leftTileRenderer.material.color = defaultColor;
        }

        Renderer rightTileRenderer = rightDoorTileController.GetComponent <Renderer>();

        if (map.getRightChild() != 0)
        {
            rightDoorTileController.rightDoor = true;
            rightTileRenderer.material.color  = Color.green;
        }
        else
        {
            rightDoorTileController.rightDoor = false;
            rightTileRenderer.material.color  = defaultColor;
        }

        Renderer backTileRenderer = backDoorTileController.GetComponent <Renderer>();

        if (map.getParent() != 0)
        {
            backDoorTileController.backDoor = true;
            backTileRenderer.material.color = Color.green;
        }
        else
        {
            backDoorTileController.backDoor = false;
            backTileRenderer.material.color = defaultColor;
        }
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        //cash
        //transform cash
        cashTransform = transform;
        //sprite renderer
        sr = GetComponent <SpriteRenderer>();
        //maincontroller
//		mainCtr = GameObject.Find ("mainController");
//		mc = mainCtr.GetComponent<mainController> ();
        //map controller
        mpCtr = GameObject.Find("mapController");
        mpc   = mpCtr.GetComponent <mapController> ();

        //scale
        scl    = 0.0f;
        spdscl = 0.0f;

        //back color
        backcr = sr.color;

        //system init
        intervalCnt = 0;

        //scroll speed
        speed_y = 0.0f;

        //scroll x move
        mpxmov = 0;

        //blink
        blink   = false;
        blalpha = false;
        blback  = 0.0f;
        blinc   = false;

        //set new status
        this.setNewStatus();

//		//objnum inc
//		mc.incObj();
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
//		data = GameObject.FindGameObjectWithTag("data").GetComponent<dataContainer>();
        masterList        = GetComponentInChildren <masterListController>();
        timeController    = GameObject.Find("TimeController").GetComponent <timeController>();
        weatherController = GetComponent <weatherController>();
        cameraController  = GameObject.Find("Camera").GetComponent <cameraController>();
        mapController     = GetComponent <mapController>();
        battleController  = GetComponent <battleController>();
        currentParty      = new GameObject[maxPartySize];
        loadCharas();
//		playerController = GameObject.FindGameObjectWithTag("Player").GetComponent<playerController>();
//		inventoryController = GetComponent<inventoryController>();
//		loadInventory();
//
//		objectController = GameObject.Find("objectController").GetComponent<objectController>();
//		itemController = GameObject.Find("itemController").GetComponent<itemController>();
//		enemyController = GameObject.Find("enemyController").GetComponent<enemyController>();

        menu.SetActive(false);
        playerController.isControllable = true;
        cameraController.isControllable = true;
    }
    // Use this for initialization
    void Start()
    {
        ourBPM      = 90f;
        beatTimer   = ourBPM / 60f;
        currentBeat = 1;

        fakeRoomCamera.aspect = 1.3333f;

        //We start on the first level,
        currentLevel = 1;
        //Which is at this position on the map array
        mapPosition[0] = 2; mapPosition[1] = 2;

        doorOpen           = musicBits[musicBits.Length - 1];
        myAudioSource      = GetComponent <AudioSource>();
        myAudioSource.clip = doorOpen;
        doorOpenPlayed     = false;
        mainDoorOpened     = new bool[17];
        secretDoorOpened   = new bool[2];

        //13 is the dead end so the go back door is just the normal door
        mainDoorOpened[13] = true;

        mySpriteRenderer = GetComponent <SpriteRenderer>();

        //myTextMesh = GetComponentInChildren<TextMesh>();

        smallDoorScript = smallDoor.GetComponent <smallDoorController>();

        mapScript = GameObject.Find("map").GetComponent <mapController>();

        youScript = GameObject.FindWithTag("Player").GetComponent <youController>();

        pauseMenu = false;

        newLevel();
    }
Ejemplo n.º 8
0
 private void Start()
 {
     mapController    = this.GetComponentInParent <mapController>();
     originalPosition = this.transform.position;
 }
Ejemplo n.º 9
0
 private void Start()
 {
     map = FindObjectOfType <mapController>();
 }