コード例 #1
0
 public hurdle()
 {
     passed = false;
     x      = 599;
     next   = null;
     Graphics.FromImage(b).Clear(Color.Black);
 }
コード例 #2
0
 void init()
 {
     t.Interval = 100;
     t.Start();
     h       = new hurdle();
     me.life = 100;
 }
コード例 #3
0
    void draw(object o, EventArgs e)
    {
        if (me.life < 0)
        {
            failed();
        }
        check();
        Graphics.FromImage(bit).Clear(Color.Green);
        Graphics.FromImage(bit).DrawLine(new Pen(Color.Black, 5), new Point(0, 150), new Point(600, 150));
        hurdle i;

        if (h.x < 10)
        {
            h = h.next;
        }
        for (i = h; i != null; i = i.next)
        {
            i.draw(bit);
        }
        if (h == null)
        {
            h = new hurdle(); h.next = null;
        }
        me.draw(bit);
        for (i = h; i.next != null; i = i.next)
        {
            ;
        }
        if (r.Next() % 20 == 0)
        {
            i.next = new hurdle();
        }
        CreateGraphics().DrawImage(bit, 0, 0);
    }