标题:怎样才能使贪吃蛇动?
取消只看楼主
caomoshijia
Rank: 2
等 级:论坛游民
帖 子:43
专家分:20
注 册:2009-8-8
结帖率:83.33%
 问题点数:0 回复次数:0 
怎样才能使贪吃蛇动?
这是我的代码目前只画了3个方块:

using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        int i = 0;
   
        public Form1()
        {
            InitializeComponent();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (i == 1)
            {
                Double d = 6;
                this.Opacity -= d / 100;
                if (Opacity == 0)
                {
                    this.Close();
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            i = 1;
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            Graphics form = pictureBox1.CreateGraphics();
            SolidBrush bursh = new SolidBrush(Color.Black);
            int number = 0;
            this.Refresh();
            for (int a = 0; a < 3; a++)
            {
               
                form.FillRectangle(bursh, 10 + number, 10, 5, 5);
               
                number += 6;
               
            }
           
           
         
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer2.Start();
        }
    }
}
搜索更多相关主题的帖子: 贪吃 
2010-01-24 16:05



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-296405-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.294731 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved