Ejemplo n.º 1
0
        public void ChangeWords(string words)
        {
            TextSize = words.Length;
            DeleteWords();

            foreach (char letter in words)
            {
                if ((int)letter > 64 && (int)letter < 91 || (int)letter == 95)
                {
                    int letval = (int)letter - 65;

                    if ((int)letter == 95)
                    {
                        letval = 26;
                    }

                    if (letval > -1 && letval < 27)
                    {
                        AModel letterE = InitiateLetter(letval);
                        letterE.Scale = Scale;
                    }
                }

                if ((int)letter == 32)
                {
                    WordModels.Add(new AModel(Game));
                }
            }

            ChangePosition();
            ChangeRotation();
        }
Ejemplo n.º 2
0
        AModel InitiateLetter(int letter)
        {
            AModel letterModel = new AModel(Game);

            letterModel.SetModel(WordXNAModels[letter]);
            letterModel.Moveable   = false;
            letterModel.ModelScale = new Vector3(Scale);

            WordModels.Add(letterModel);

            return(WordModels.Last());
        }
Ejemplo n.º 3
0
        AModel InitiateNumber(int number)
        {
            AModel digit = new AModel(Game);

            if (number < 0)
            {
                number = 0;
            }

            digit.SetModel(NumberXNAModels[number]);
            digit.Moveable   = false;
            digit.ModelScale = new Vector3(Scale);

            NumberModels.Add(digit);

            return(NumberModels.Last());
        }
Ejemplo n.º 4
0
        public void ChangeNumber(int number)
        {
            int numberIn = number;

            ClearNumbers();

            do
            {
                //Make digit the modulus of 10 from number.
                int digit = numberIn % 10;
                //This sends a digit to the draw function with the location and size.
                AModel numberE = InitiateNumber(digit);
                numberE.Scale = Scale;
                // Dividing the int by 10, we discard the digit that was derived from the modulus operation.
                numberIn /= 10;
                // Move the location for the next digit location to the left. We start on the right hand side
                // with the lowest digit.
            } while (numberIn > 0);

            ChangePosition();
        }
Ejemplo n.º 5
0
        public override void Initialize()
        {
            float spinSpeed = 7.5f;

            for (int i = 0; i < Stars.Length; i++)
            {
                Stars[i] = new Engine.AModel(Game);
            }

            for (int i = 0; i < StarsBack.Length; i++)
            {
                StarsBack[i] = new Engine.AModel(Game);
            }

            for (int i = 0; i < Stars.Length; i++)
            {
                Stars[i].Position         = new Vector3(Services.RandomMinMax(-6000, 6000), Services.RandomMinMax(-4000, 4000), -200);
                Stars[i].RotationVelocity = new Vector3(Services.RandomMinMax(-spinSpeed, spinSpeed),
                                                        Services.RandomMinMax(-spinSpeed, spinSpeed), Services.RandomMinMax(-spinSpeed, spinSpeed));
                Stars[i].Scale = 0.5f;
            }

            for (int i = 0; i < StarsBack.Length; i++)
            {
                StarsBack[i].Position         = new Vector3(Services.RandomMinMax(-600, 600), Services.RandomMinMax(-450, 450), -900);
                StarsBack[i].RotationVelocity = new Vector3(Services.RandomMinMax(-spinSpeed, spinSpeed),
                                                            Services.RandomMinMax(-spinSpeed, spinSpeed), Services.RandomMinMax(-spinSpeed, spinSpeed));
                StarsBack[i].Scale       = Services.RandomMinMax(0.5f, 1);
                StarsBack[i].DefuseColor = new Vector3(Services.RandomMinMax(0.05f, 2), Services.RandomMinMax(0, 0.2f),
                                                       Services.RandomMinMax(0.1f, 3));
                StarsOrg[i] = StarsBack[i].Position;
            }

            base.Initialize();
            Services.AddBeginable(this);
            Services.AddLoadable(this);
        }
Ejemplo n.º 6
0
 void RemoveNumber(AModel numberE)
 {
     NumberModels.Remove(numberE);
 }