• 大小: 192KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-13
  • 语言: C#
  • 标签:

资源简介

C#贪吃蛇游戏源代码 开发环境是visual studio 2010 其中内容加入了背景音乐,支持重新开始

资源截图

代码片段和文件信息

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
using System.Runtime.InteropServices;
using System.Media; 
using System.IO; 



namespace Wsnake
{
    //移动方向
    public enum Way
    {
        EAST
        SOUTH
        WEST
        NORTH
    }
 
    /// 
    /// Form1 的摘要说明。
    /// 

    public class MainForm : System.Windows.Forms.Form
    {
        //移动速度控制
        private int speed = 500;
        //食物坐标
        private Point foodPoint;
        //食物颜色
        private System.Drawing.Color foodColor = System.Drawing.Color.Green;
        //统计吞下多少食物
        private int foodCount = 0;
        //是否停止游戏
        private bool isStop = false;
        private System.Windows.Forms.Panel panel1;
        private SnakeMod snake = new SnakeMod();
        SoundPlayer music = new SoundPlayer(); 
        private System.Windows.Forms.Button button1;
        private Thread game;
        private IContainer components;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.MainMenu mainMenu1;
        private System.Windows.Forms.MenuItem menuItem1;
        private System.Windows.Forms.MenuItem menuItem2;
        private System.Windows.Forms.MenuItem menuItem3;
        private System.Windows.Forms.MenuItem menuItem4;
        private System.Windows.Forms.MenuItem menuItem5;
        private System.Windows.Forms.MenuItem menuItem6;
        private System.Windows.Forms.MenuItem menuItem7;
        private System.Windows.Forms.MenuItem menuItem8;
        private System.Windows.Forms.MenuItem menuItem9;
        private System.Windows.Forms.MenuItem menuItem10;
        private System.Windows.Forms.MenuItem menuItem11;
        private System.Windows.Forms.MenuItem menuItem12;
        private System.Windows.Forms.MenuItem menuItem13;
        private System.Windows.Forms.MenuItem menuExit;
        private System.Windows.Forms.Label label2;
        //创建委托
        private delegate void DrawDele();
        private DrawDele drawDelegate;

        public MainForm()
        {
            //
            // Windows 窗体设计器支持所必需的
            //
            InitializeComponent();
            //
            // TODO: 在 InitializeComponent 调用后添加任何构造函数代码
            //
        }

        /// 
        /// 清理所有正在使用的资源。
        /// 

        protected override void Dispose(bool disposing)
        {
            try
            {
                game.Abort();
            }
            catch
            {
            }
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       7476  2010-06-18 16:47  Wsnake\Wsnake\bin\Debug\Music.wav

     文件      18944  2010-07-22 10:24  Wsnake\Wsnake\bin\Debug\Wsnake.exe

     文件      46592  2010-07-22 10:24  Wsnake\Wsnake\bin\Debug\Wsnake.pdb

     文件      11600  2010-07-22 10:24  Wsnake\Wsnake\bin\Debug\Wsnake.vshost.exe

     文件      20386  2010-07-22 10:38  Wsnake\Wsnake\MainForm.cs

     文件       6014  2010-07-21 21:05  Wsnake\Wsnake\MainForm.resx

     文件        999  2010-07-22 09:58  Wsnake\Wsnake\Media.cs

     文件       4501  2010-07-18 13:17  Wsnake\Wsnake\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6380  2010-07-22 10:24  Wsnake\Wsnake\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        818  2010-07-22 10:07  Wsnake\Wsnake\obj\x86\Debug\GenerateResource.read.1.tlog

     文件       1702  2010-07-22 10:07  Wsnake\Wsnake\obj\x86\Debug\GenerateResource.write.1.tlog

     文件       8031  2010-07-21 20:07  Wsnake\Wsnake\obj\x86\Debug\ResolveAssemblyReference.cache

     文件       1898  2010-07-18 14:06  Wsnake\Wsnake\obj\x86\Debug\SimpleForm.application

     文件       1480  2010-07-19 17:06  Wsnake\Wsnake\obj\x86\Debug\SimpleForm.csproj.FileListAbsolute.txt

     文件    1631744  2010-07-18 14:06  Wsnake\Wsnake\obj\x86\Debug\SimpleForm.exe

     文件       3029  2010-07-18 14:06  Wsnake\Wsnake\obj\x86\Debug\SimpleForm.exe.manifest

     文件    1622228  2010-07-18 14:04  Wsnake\Wsnake\obj\x86\Debug\SimpleForm.Form1.resources

     文件      26112  2010-07-18 14:06  Wsnake\Wsnake\obj\x86\Debug\SimpleForm.pdb

     文件        180  2010-07-18 14:04  Wsnake\Wsnake\obj\x86\Debug\SimpleForm.Properties.Resources.resources

     文件        937  2010-07-22 10:24  Wsnake\Wsnake\obj\x86\Debug\Wsnake.csproj.FileListAbsolute.txt

     文件      18944  2010-07-22 10:24  Wsnake\Wsnake\obj\x86\Debug\Wsnake.exe

     文件        180  2010-07-22 10:07  Wsnake\Wsnake\obj\x86\Debug\Wsnake.MainForm.resources

     文件      46592  2010-07-22 10:24  Wsnake\Wsnake\obj\x86\Debug\Wsnake.pdb

     文件        180  2010-07-22 10:07  Wsnake\Wsnake\obj\x86\Debug\Wsnake.Properties.Resources.resources

     文件        490  2010-07-21 13:20  Wsnake\Wsnake\Program.cs

     文件       1370  2010-07-18 12:56  Wsnake\Wsnake\Properties\AssemblyInfo.cs

     文件       2868  2010-07-18 12:56  Wsnake\Wsnake\Properties\Resources.Designer.cs

     文件       5612  2010-07-18 12:56  Wsnake\Wsnake\Properties\Resources.resx

     文件       1093  2010-07-18 12:56  Wsnake\Wsnake\Properties\Settings.Designer.cs

     文件        249  2010-07-18 12:56  Wsnake\Wsnake\Properties\Settings.settings

............此处省略18个文件信息

评论

共有 条评论

相关资源