Exemple #1
0
        public static Ball getBall(ballType t)
        {
            BallAttribute local = getAtribute(t);
            Ball          r     = new Ball(local.life, local.size, local.color);

            return(r);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Ball"/> class.
 /// </summary>
 /// <param name="positionx">The positionx.</param>
 /// <param name="positiony">The positiony.</param>
 /// <param name="radius">The radius.</param>
 /// <param name="typeofball">The typeofball.</param>
 /// <param name="ballimage">The ballimage.</param>
 public Ball(double positionx, double positiony, double radius, ballType typeofball, string ballimage)
 {
     positionX   = positionx;
     positionY   = positiony;
     this.radius = radius;
     typeOfBall  = typeofball;
     ballImage   = ballimage;
 }
Exemple #3
0
 void setUpCharacter(Character character)
 {
     gameObject.GetComponent <SpriteRenderer>().sprite = character.sprite;
     type = (Ball.ballType)character.type;
     ballTransform.localScale = new Vector3((1f * character.scale), (1f * character.scale), 1);
     speed            = character.speed;
     turning          = character.turning;
     specialTimeBoost = character.specialTimeBoost;
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Ball"/> class.
 /// </summary>
 /// <param name="positionx">The positionx.</param>
 /// <param name="positiony">The positiony.</param>
 /// <param name="radius">The radius.</param>
 /// <param name="typeofball">The typeofball.</param>
 /// <param name="ballimage">The ballimage.</param>
 public Ball(double positionx, double positiony, double radius, ballType typeofball, string ballimage)
 {
     positionX = positionx;
     positionY = positiony;
     this.radius = radius;
     typeOfBall = typeofball;
     ballImage = ballimage;
 }
Exemple #5
0
 public static BallAttribute getAtribute(ballType t)
 {
     return((BallAttribute)Attribute.GetCustomAttribute(
                typeof(ballType).GetField(Enum.GetName(typeof(ballType), t)),
                typeof(BallAttribute)));
 }