コード例 #1
0
        protected override AliveObject create()
        {
            PictureBox heart = new PictureBox();

            heart.SizeMode = PictureBoxSizeMode.AutoSize;
            heart.Image    = _heartBitmap;
            int w = _heartBitmap.Width;
            int h = _heartBitmap.Height;

            heart.Size = new Size(w, h);
            AliveObject ao = new AliveObject(heart);

            return(ao);
        }
コード例 #2
0
 public void update(object source, EventArgs args)
 {
     for (int i = _isUse.Count - 1; i >= 0; i--)
     {
         AliveObject pic = _isUse[i];
         pic.move();
         Point location = pic.Picture.Location;
         if (location.X < 0 || location.X > GameLoop.LimitX || location.Y < 0 || location.Y > GameLoop.LimitY)
         {
             _isUse.RemoveAt(i);
             _form.Controls.Remove(pic.Picture);
             if (onExitForm != null)
             {
                 onExitForm(this, EventArgs.Empty);
             }
         }
     }
 }
コード例 #3
0
 protected abstract void init(AliveObject pic, Point currentPosition);
コード例 #4
0
 protected override void init(AliveObject pic, Point currentPosition)
 {
     pic.init(currentPosition, rand.Next(-9, 7), -5);
 }