Beispiel #1
0
 // Use this for initialization
 void Start()
 {
     player    = FindObjectOfType <PlayerScript2> ();
     enemyBody = FindObjectOfType <Rigidbody2D> ();
     enemyBody.freezeRotation = true;
     animator = GetComponent <Animator>();
 }
Beispiel #2
0
    public float strength = 50; //Bullets and slashing are equal to start

    void Start()
    {
        //bulletBox = FindObjectOfType<BoxCollider2D> ();
        player = FindObjectOfType <PlayerScript2>(); //Finds the players location

        //bulletMoving = false;

        //These next statement determine which direction to shoot the bullet in
        if (player.getDirectionString() == "r")
        {
            shootRight();
        }
        if (player.getDirectionString() == "l")
        {
            shootLeft();
            //transform.rotation()
        }
        if (player.getDirectionString() == "u")
        {
            shootUp();
        }
        if (player.getDirectionString() == "d")
        {
            shootDown();
        }
    }
 // Use this for initialization
 void Start()
 {
     player    = new Rigidbody2D();
     p2Script  = gameManager.opponentCharacter.GetComponent <PlayerScript2> ();
     playerMov = this.gameController.P1.GetComponent <Animator> ();
     player    = this.gameController.P1.GetComponent <Rigidbody2D> ();
 }
Beispiel #4
0
 void Start()
 {
     //animator = FindObjectOfType<Animator> ();
     animator          = GetComponent <Animator>();           //Finds the animator component
     player            = FindObjectOfType <PlayerScript2> (); //Finds the players location
     bulletOrientation = Bullet.GetComponent <SpriteRenderer>();
 }
Beispiel #5
0
 // Use this for initialization
 void Start()
 {
     player = FindObjectOfType <PlayerScript2>();
     StartCoroutine("LoseTime");
     levelLoadCanvas.SetActive(true);
     barCanvas.SetActive(false);
 }
Beispiel #6
0
    void Update()
    {
        // If player has contacted enemy
        player = GameObject.Find("Player").GetComponent <PlayerScript2>();
        if (player.gameOver)
        {
            // Tell the animator the game is over
            // Don't have animator set up yet
            player.canControl = false;
            GameObject.Find("Player").GetComponent <Rigidbody2D>().velocity = noMovement;
            Invoke("GameOver", levelStartDelay);
//			// increment a timer to count up to restarting
//			restartTimer += Time.deltaTime;
//
//			// if it reaches the restart delay
//			if (restartTimer >= restartDelay) {
//				// Reload the currently loaded level
//				SceneManager.LoadScene("game");
//			}
        }
        else if (player.isComplete)
        {
            player.canControl = false;
            GameObject.Find("Player").GetComponent <Rigidbody2D>().velocity = noMovement;
            GameObject.Find("Enemy").GetComponent <Rigidbody2D>().velocity  = noMovement;
            Invoke("Complete", levelStartDelay);
        }
    }
Beispiel #7
0
 // Use this for initialization
 void Start()
 {
     player = FindObjectOfType <PlayerScript2>();
     shop   = FindObjectOfType <playerShop>();
     // GameObject player = GameObject.Find("Player")
     // shooting shootsc = FindObjectOfType<shooting>();
     equipDag = true;
 }
Beispiel #8
0
    // Use this for initialization
    public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
    {
        LobbyPlayer   lobby = lobbyPlayer.GetComponent <LobbyPlayer>();
        PlayerScript2 p     = gamePlayer.GetComponent <PlayerScript2>();

        p.playerName = lobby.playerName;
        p.color      = new PlayerScript2.PlayerColor(lobby.playerColor.r, lobby.playerColor.g, lobby.playerColor.b);
    }
Beispiel #9
0
 // Used for initialization
 void Start()
 {
     player    = FindObjectOfType <PlayerScript2>();
     enemyBody = FindObjectOfType <Rigidbody2D>();
     animator  = FindObjectOfType <Animator>();
     enemyBody.freezeRotation = true;         //IMPORTANT! ENEMY MUST BE KINEMATIC
     playerInRange            = false;
     //enemyRange.enabled = true;
 }
Beispiel #10
0
 // Use this for initialization
 void Start()
 {
     SceneNum = SceneManager.GetActiveScene().buildIndex;
     print(SceneNum);
     player         = GetComponent <PlayerScript2> ();
     currentHealth  = startingHealth;
     healthUI       = healthImage.GetComponent <Animator> ();
     healthUI.speed = 0;
     time           = 0;
 }
Beispiel #11
0
    private bool triggered = false;      // Set to true when the 'trap' is triggered

    // Used for initialization
    void Start()
    {
        player    = FindObjectOfType <PlayerScript2>();
        enemyBody = FindObjectOfType <Rigidbody2D>();
        animator  = FindObjectOfType <Animator>();
        enemyBody.freezeRotation = true; //IMPORTANT! ENEMY MUST BE KINEMATIC
        playerInRange            = false;
        spawnSpot = transform.position;
        goalSpot  = spawnSpot;
    }
 //Initializes the boxes to off
 void Start()
 {
     left.enabled  = false;
     right.enabled = false;
     up.enabled    = false;
     down.enabled  = false;
     player        = FindObjectOfType <PlayerScript2> ();
     //animator = FindObjectOfType<Animator> ();
     animator = GetComponent <Animator>();
 }
Beispiel #13
0
    void InitGame()
    {
        player            = GameObject.Find("Player").GetComponent <PlayerScript2>();
        player.canControl = false;
        levelImage        = GameObject.Find("LevelImage");
        levelText         = GameObject.Find("LevelText").GetComponent <Text> ();
        levelText.text    = "Level " + level;
//		enemies.clear ();
//		boardScript.SetupScene (level);
        Invoke("HideLevelImage", levelStartDelay);
    }
Beispiel #14
0
 // Use this for initialization
 void Start()
 {
     player    = FindObjectOfType <PlayerScript2>();
     playerbar = FindObjectOfType <BarScript>();
     enemy     = FindObjectOfType <EnemyScript>();
 }
 // Start is called before the first frame update
 void Start()
 {
     playerScript = player.GetComponent <PlayerScript2>();
     CreateIcons();
 }
Beispiel #16
0
 private void Start()
 {
     target  = GameObject.Find("Player");        // The target of the game object
     player  = GameObject.Find("Player").GetComponent <PlayerScript2>();
     _centre = transform.position;
 }
Beispiel #17
0
    public float strength = 50;     //Bullets and slashing are equal to start

    void Start()
    {
        player = FindObjectOfType <PlayerScript2>();
        shootRight();
    }
Beispiel #18
0
 void Start()
 {
     //animator = FindObjectOfType<Animator> ();
     animator = GetComponent <Animator>();           //Finds the animator component
     player   = FindObjectOfType <PlayerScript2> (); //Finds the players location
 }
Beispiel #19
0
 void Start()
 {
     player = FindObjectOfType <PlayerScript2> ();        //Finds the player object
 }
Beispiel #20
0
 // Use this for initialization
 void Start()
 {
     inventory = FindObjectOfType <Inventory>();
     player    = FindObjectOfType <PlayerScript2>();
 }
Beispiel #21
0
 // Use this for initialization
 void Start()
 {
     playerScript = player.GetComponent <PlayerScript2> ();
     timer.text   = playerScript.timeLeft.ToString();
 }