| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 566 人关注过本帖
标题:怎样才能使贪吃蛇动?
取消只看楼主 加入收藏
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
快速回复:怎样才能使贪吃蛇动?
数据加载中...
 
   



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

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