public void EnemyCreation()
    {
        randomEnemy = Random.Range(0, 2);

        SelectedCharacterSprite = this.GetComponent <SpriteRenderer>();

        Transform         firepoint1   = Enemy.transform.Find("Firepoint");
        Transform         firpoint2    = Enemy.transform.Find("Firepoint3");
        Transform         missilePoint = Enemy.transform.Find("MissilePoint");
        CapsuleCollider2D collider     = Enemy.GetComponent <CapsuleCollider2D>();

        switch (randomEnemy)
        {
        case 0:
            SelectedCharacterSprite.sprite = SCALPEL;
            EnemyShip = new ScalpelSpaceship();
            enemyIdleAnimation.SetInteger("ShipIndex", 1);
            firepoint1.localPosition   = new Vector2(-28.5f, 10.4f);
            firpoint2.localPosition    = new Vector2(-34, 0);
            missilePoint.localPosition = new Vector2(-5.3f, -4.4f);



            break;



        case 1:
            SelectedCharacterSprite.sprite = WARPER;

            EnemyShip = new WarperSpaceship();
            enemyIdleAnimation.SetInteger("ShipIndex", 2);
            firepoint1.localPosition   = new Vector2(-28.5f, 10.4f);
            firpoint2.localPosition    = new Vector2(-34, 0);
            missilePoint.localPosition = new Vector2(-5.3f, -4.4f);

            break;

        case 2:
            SelectedCharacterSprite.sprite = ORION;
            EnemyShip = new OrionSpaceship();
            enemyIdleAnimation.SetInteger("ShipIndex", 0);
            firepoint1.localPosition   = new Vector2(-28.5f, 10.4f);
            firpoint2.localPosition    = new Vector2(-34, 0);
            missilePoint.localPosition = new Vector2(-5.3f, -4.4f);

            break;
        }
    }
Esempio n. 2
0
    public void PlayerCreation()
    {
        SelectedCharacterSprite = this.GetComponent <SpriteRenderer>();
        getCharacter            = PlayerPrefs.GetInt(SelectedCharacter);
        //BasePlayerClass Player = new BasePlayerClass(chosenShip);
        Transform firepoint1   = Player.transform.Find("Firepoint");
        Transform firpoint2    = Player.transform.Find("Firepoint3");
        Transform missilePoint = Player.transform.Find("MissilePoint");

        switch (getCharacter)
        {
        case 0:
            SelectedCharacterSprite.sprite = SCALPEL;
            chosenShip = new ScalpelSpaceship();
            playerIdleAnimation.SetInteger("ShipIndex", 0);
            firepoint1.localPosition   = new Vector2(28.5f, 10.4f);
            firpoint2.localPosition    = new Vector2(34, 0);
            missilePoint.localPosition = new Vector2(5.3f, -4.4f);

            break;



        case 1:
            SelectedCharacterSprite.sprite = WARPER;
            chosenShip = new WarperSpaceship();
            playerIdleAnimation.SetInteger("ShipIndex", 2);
            firepoint1.localPosition   = new Vector2(6.7f, 14.8f);
            firpoint2.localPosition    = new Vector2(34, 0);
            missilePoint.localPosition = new Vector2(5.3f, -4.4f);

            break;

        case 2:
            SelectedCharacterSprite.sprite = ORION;
            chosenShip = new OrionSpaceship();
            playerIdleAnimation.SetInteger("ShipIndex", 1);
            firepoint1.localPosition   = new Vector2(28.5f, 10.4f);
            firpoint2.localPosition    = new Vector2(34, 0);
            missilePoint.localPosition = new Vector2(5.3f, -4.4f);

            break;
        }
        //return Player.SpaceshipClass;
    }
Esempio n. 3
0
 public BasePlayerClass(BaseSpaceshipClass chosenShip)
 {
     chosenShip = SpaceshipClass;
 }