Exemplo n.º 1
0
    private void Start()
    {
        enemy2           = GetComponent <PlaneEnemy>();
        enemy2.LifeEnemy = 200;

        animBigExplodeEnemy = GetComponent <Animator>();
        animMoveEnemy2Left  = GetComponent <Animator>();
        animMoveEnemy2Right = GetComponent <Animator>();
        animMoveEnemy2Down  = GetComponent <Animator>();

        stEnemy         = StatusEnemy.normal;
        shotThrowEnemy2 = true;

        //move
        if (GameManager.instance.gameStatus == GameStatus.Start)
        {
            StartCoroutine(Shot());
        }

        // define direções de movimento do inimigo
        rand = Random.Range(-1, 1);
        if (rand == 0)
        {
            rand = 1;
        }
        rand = rand / 100;

        targetUpEnemy2   = GameObject.Find("TargetUpEnemy2").GetComponent <Transform>();
        targetDownEnemy2 = GameObject.Find("TargetDownEnemy2").GetComponent <Transform>();

        // variavel que vai indicar se o avião vai estar baixo ou alto
        movePos = -1;

        Anim();
    }
Exemplo n.º 2
0
 void Start()
 {
     enemy3           = GetComponent <PlaneEnemy>();
     enemy3.LifeEnemy = 3;
     step             = -0.011f;
     stEnemy          = StatusEnemy.normal;
     // define um valor para o momento em que o inimigo vai atirar ele tb pode atirar qnd chegar próximo do player
     rand = Random.Range(-2, 4);
 }
Exemplo n.º 3
0
 private void Start()
 {
     moveEnemy1       = GetComponent <Animator>();
     posEnemy         = GetComponent <Transform>();
     step             = -0.01f;
     stEnemy          = StatusEnemy.normal;
     enemy1           = GetComponent <PlaneEnemy>();
     enemy1.LifeEnemy = 3;
     rand             = Random.Range(0, 2);
 }
Exemplo n.º 4
0
 void Start()
 {
     enemy5           = GetComponent <PlaneEnemy>();
     enemy5.LifeEnemy = 100;
     feedbackDano     = GetComponent <Animator>();
     step             = 0.01f;
     stEnemy          = StatusEnemy.normal;
     tagLeft          = GameObject.Find("TagLeft").GetComponent <Transform>();
     tagRight         = GameObject.Find("TagRight").GetComponent <Transform>();
 }
Exemplo n.º 5
0
        /// <summary>
        /// �K�v�ȃR���e���c�̓ǂݍ��݂�s���܂�
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Content.RootDirectory = @"Content\gameContent";
            Model model1 = this.Content.Load<Model> ("untitled");
            CharactorPalameter playerPara = new CharactorPalameter();
            playerPara.pos = new Vector3(0);
            playerPara.Dir = new Vector3(0, 0, 1);
            playerPara.MaxSpeed = 1;
            player = new Player(this.Content.Load<Model>("untitled"), playerPara);
            enemies = new Enemies();
            CharactorPalameter planePara = new CharactorPalameter();
            planePara.pos = new Vector3(0,0,10);
            planePara.Dir = new Vector3(1,0,0);
            PlaneEnemy plane = new PlaneEnemy(this.Content.Load<Model>("untitled"), planePara);
            enemies.Add(plane);

            mainCamera = new PlayerCamera(player, MathHelper.ToRadians(45.0f),
                                          (float)this.GraphicsDevice.Viewport.Width /
                                            (float)this.GraphicsDevice.Viewport.Height);

            base.LoadContent();
        }