Beispiel #1
0
        public static EnemyOrb Make(OrbStyle style, CGSize playgroundSize)
        {
            EnemyOrb orb = new EnemyOrb();

            orb.Style          = style;
            orb.playgroundSize = playgroundSize;

            if (style == OrbStyle.blue)
            {
                // orb.color = ColorConstants.blueColor;
                orb.brush            = new SolidBrush(ColorConstants.blueColor);
                orb.characterTexture = blueTexture;
                orb.texture          = Constants.enemyOrbInBlue;
            }
            else
            {
                // orb.color = ColorConstants.purpleColor;
                orb.brush            = new SolidBrush(ColorConstants.purpleColor);
                orb.characterTexture = purpleTexture;
                orb.texture          = Constants.enemyOrbInPurple;
            }

            orb.frame.size = new CGSize(50, 50);

            orb.frame.origin.x = (float)(randomizer.NextDouble() * playgroundSize.width);
            orb.frame.origin.y = (float)(randomizer.NextDouble() * playgroundSize.height);

            orb.destination = orb.frame.origin;

            return(orb);
        }
Beispiel #2
0
        public static EnemyOrb MakeRandom(CGSize playgroundSize)
        {
            OrbStyle style = OrbStyle.blue;

            if (randomizer.NextDouble() > 0.5)
            {
                style = OrbStyle.purple;
            }

            return(Make(style, playgroundSize));
        }
Beispiel #3
0
 public void ChangeOrbStyle()
 {
     if (Style == OrbStyle.blue)
     {
         Style   = OrbStyle.purple;
         texture = Constants.playerOrbInPurple;
     }
     else
     {
         Style   = OrbStyle.blue;
         texture = Constants.playerOrbInBlue;
     }
 }
Beispiel #4
0
 public void SetDefaultOrbStyle()
 {
     Style = OrbStyle.purple;
     ChangeOrbStyle();
 }