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)); }
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)); }
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); }
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(); }
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(); }); }
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); }
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); }
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)); } }