示例#1
0
        protected override void PopSentence(string sentence)
        {
            Color color = Color.FromArgb(rand.Next(255), rand.Next(255), rand.Next(255));
            Font  font  = App.GetInstance().InternalFont.getFont(0, rand.Next(35, 40));

            objects.Insert(0, new MovableStyle1Object(100.0f, 100.0f, 0.0f, null, sentence, color, font));
        }
示例#2
0
        private void PutRaindrop(bool top = true)
        {
            ISurface surface = App.GetInstance().Surface;
            float    x       = rand.Next(0, surface.ScreenWidth + 50);
            float    y       = top ? -rand.Next(100, 600) : rand.Next(-100, surface.ScreenHeight);
            float    scale   = rand.Next(50, 100) / 100.0f;
            Image    texture = imageRes[rand.Next(imageRes.Count)];

            objects.Insert(0, new MovableStyle5Object(x, y, scale, texture, null, Color.Black, null));
        }
示例#3
0
 public frmMain()
 {
     Text            = "Valentine Day In My Brain!";
     TopMost         = true;
     MinimizeBox     = false;
     FormBorderStyle = FormBorderStyle.FixedSingle;
     WindowState     = FormWindowState.Maximized;
     BackColor       = Color.White;
     Controls.Add(App.GetInstance().Surface as Control);
 }
示例#4
0
 protected override void PrepareMajor()
 {
     for (int i = 0; i < 15; i++)
     {
         ISurface surface = App.GetInstance().Surface;
         float    x       = rand.Next(10, surface.ScreenWidth - 200);
         float    y       = rand.Next(100, surface.ScreenHeight - 100);
         float    scale   = rand.Next(50, 200) / 100.0f;
         Image    texture = imageRes[rand.Next(imageRes.Count)];
         objects.Add(new MovableStyle1Object(x, y, scale, texture, null, Color.Black, null));
     }
     StartTimer();
 }
示例#5
0
 protected void StartTimer()
 {
     Task.Run(async() =>
     {
         for (int i = 0; i < stringRes.Count; i++)
         {
             string sentence = stringRes[i];
             App.GetInstance().Surface.RunSafe((MethodInvoker) delegate { PopSentence(sentence); });
             await Task.Delay(waitEachSentence);
         }
         stringRes.Clear();
     });
 }
示例#6
0
        protected override void PopSentence(string sentence)
        {
            ISurface   surface = App.GetInstance().Surface;
            float      x       = surface.ScreenWidth / 2.0f + rand.Next(-300, 50);
            float      y       = surface.ScreenHeight - 10.0f;
            Color      color   = Color.FromArgb(rand.Next(10, 255), 0, rand.Next(10, 255));
            Font       font    = App.GetInstance().InternalFont.getFont(0, rand.Next(35, 40));
            Image      angel   = angels[rand.Next(angels.Count)];
            GameObject obj     = new MovableStyle2Object(x, y, 1.0f, angel, sentence, color, font);

            obj.Tag    = TAG_SENTENCE;
            obj.SpeedY = -0.5f;
            objects.Add(obj);
        }
示例#7
0
        protected override void PopSentence(string sentence)
        {
            ISurface   surface = App.GetInstance().Surface;
            float      x       = -150.0f;
            float      y       = surface.ScreenHeight / 2.0f - 150.0f;
            Color      color   = Color.FromArgb(rand.Next(10, 255), 0, rand.Next(10, 255));
            Font       font    = App.GetInstance().InternalFont.getFont(0, rand.Next(35, 40));
            Image      angel   = girlPhotos[rand.Next(girlPhotos.Count)];
            GameObject obj     = new MovableStyle3Object(x, y, 1.0f, angel, sentence, color, font);

            obj.Tag    = TAG_SENTENCE;
            obj.SpeedX = 0.4f;
            objects.Add(obj);
        }
示例#8
0
        private void GenerateObjects(bool first = false)
        {
            ISurface surface = App.GetInstance().Surface;
            int      count   = objects.Count;

            for (int i = 0; i < MAX_OBJ - count; i++)
            {
                float x       = rand.Next(0, surface.ScreenWidth + 50);
                float y       = surface.ScreenHeight + rand.Next(100, 600) * (first ? -1.0f : 1.0f);
                float scale   = rand.Next(50, 100) / 100.0f;
                Image texture = imageRes[rand.Next(imageRes.Count)];
                objects.Insert(0, new MovableStyle2Object(x, y, scale, texture, null, Color.Black, null));
            }
        }