Ejemplo n.º 1
0
 public Bullet(Constants.DIRECTIONS direction, Player player)
 {
     Direction      = direction;
     this.PositionX = player.PositionX + (player.Width / 2);
     this.PositionY = player.PositionY + (player.Height / 2);
     this.Width     = 25;
     this.Height    = 25;
     Velocity       = 20;
     RemoveMark     = false;
     Animation      = AllAnimations.bullet;
 }
Ejemplo n.º 2
0
        public void UpAndDown()
        {
            if (y > 5)
            {
                ydirection = Constants.DIRECTIONS.DOWN;
            }
            if (y < -5)
            {
                ydirection = Constants.DIRECTIONS.UP;
            }

            switch (ydirection)
            {
            case Constants.DIRECTIONS.UP:
                this.transform.Translate(Vector3.up);
                y += 1;
                return;

            case Constants.DIRECTIONS.DOWN:
                this.transform.Translate(Vector3.down);
                y += -1;
                return;
            }
        }
Ejemplo n.º 3
0
        public void BackAndForth()
        {
            if (x > 5)
            {
                xdirection = Constants.DIRECTIONS.LEFT;
            }
            if (x < -5)
            {
                xdirection = Constants.DIRECTIONS.RIGHT;
            }

            switch (xdirection)
            {
            case Constants.DIRECTIONS.RIGHT:
                this.transform.Translate(Vector3.right);
                x += 1;
                return;

            case Constants.DIRECTIONS.LEFT:
                this.transform.Translate(Vector3.left);
                x += -1;
                return;
            }
        }