• 大小: 554KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-07
  • 语言: C#
  • 标签: 连连看  C#  

资源简介

可以自己选图片,自己定义关数。重要的是消除算法。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace lianliankan
{
    public partial class GameForm : Form
    {
        List OriCard = new List();   // 存放游戏图片的路径,用来随机
        List patterning = new List();  //游戏界面的图片规则,以*#表示,#表示此处不显示图像
        string[] strPatteRning = new string[216];
        public string[] RandCard = new string[12 18];   // 后台储存图片路径的数组,在前台显示
        //public char[] patterning = new char[12 18];
        //public List one = new List();
        //public List two = new List();             //分别记录两次点击后,第三级检测得到的值
        List one = new List();
        List two = new List();

        private string fileLevel = Program.DefaultFile + @“/LEVEL/“;
        private string fileImages = Program.DefaultFile + @“/jpg/“;
        int ClickNum = 0;     //点击的次数,用来记录点击的是第一次还是第二次
        public int card1x card1y;   //
        public int card2x card2y;  //分别记录两次点击的Xy坐标

        // public int LeftTop;

        public GameForm()    //主函数
        {
            InitializeComponent();
            CounterAir();
        }


        //int []a = new int[1010];

        private void GameFrom_Load(object sender EventArgs e)
        {
            string str = textBox1.Text;
            ReadLevelData(“第“ + textBox1.Text + “关“ + “.txt“);
            ReadDetails();
            /*MessageBox.Show(patterning[1]);
            MessageBox.Show(OriCard[0]);*/
            //patterning.Clear();
            seriation();                            //按图形分配卡片
            //MessageBox.Show(patterning[1]);
            initialize();                           //将卡片信息输出到二维数组
            //MessageBox.Show(RandCard[01]);

            display();


        }   //窗体打开时运行的事件

        private void Began()
        { }

        private void ClearCard()
        {
            for (int i = gpCard.Controls.Count - 1; i >= 0; i--)
            {
                if (gpCard.Controls[i] is PictureBox)
                    gpCard.Controls.Remove(gpCard.Controls[i]);
            }
        }

        private void addCard(string s int x int y)
        {
            if (s != “#“)
            {
                //MessageBox.Show(s);
                PictureBox t = new PictureBox();
                t.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
                t.Font = new System.Drawing.Font(“宋体“ 40F System.Drawing.Fontstyle.Regular System.Drawing.GraphicsUnit.Point ((byte)(70)));
                t.Size = new System.Drawing.Size(50 50);
                //t.TextAlign = ContentAlignment.MiddleCenter;
                t.Cursor = Cursors.Hand;
                t.SizeMode =PictureBoxSizeMode.Zoom;
               
                t.Location = new System.Drawing

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

     文件      29931  2012-11-29 14:29  lianliankan\lianliankan\bin\Debug\images\1.jpg

     文件      33719  2012-12-01 15:18  lianliankan\lianliankan\bin\Debug\images\1.png

     文件      24814  2012-11-29 14:31  lianliankan\lianliankan\bin\Debug\images\2.jpg

     文件      29776  2012-12-01 15:18  lianliankan\lianliankan\bin\Debug\images\2.png

     文件      23731  2012-11-29 14:36  lianliankan\lianliankan\bin\Debug\images\3.jpg

     文件      23937  2012-12-01 15:17  lianliankan\lianliankan\bin\Debug\images\3.png

     文件      22230  2012-11-29 14:35  lianliankan\lianliankan\bin\Debug\images\4.jpg

     文件      23633  2012-12-01 15:17  lianliankan\lianliankan\bin\Debug\images\4.png

     文件      27240  2012-11-29 14:27  lianliankan\lianliankan\bin\Debug\images\5.jpg

     文件      32162  2012-12-01 15:16  lianliankan\lianliankan\bin\Debug\images\5.png

     文件      22683  2012-11-29 14:33  lianliankan\lianliankan\bin\Debug\images\6.jpg

     文件      24805  2012-12-01 15:15  lianliankan\lianliankan\bin\Debug\images\6.png

     文件        111  2013-04-18 22:12  lianliankan\lianliankan\bin\Debug\jpg\11.txt

     文件        169  2013-05-17 01:07  lianliankan\lianliankan\bin\Debug\jpg\test.txt

     文件        238  2013-01-28 22:07  lianliankan\lianliankan\bin\Debug\LEVEL\第1关.txt

     文件        238  2013-01-28 22:09  lianliankan\lianliankan\bin\Debug\LEVEL\第2关.txt

     文件      27136  2013-04-18 22:12  lianliankan\lianliankan\bin\Debug\lianliankan.exe

     文件      73216  2013-04-18 22:12  lianliankan\lianliankan\bin\Debug\lianliankan.pdb

     文件      11600  2013-04-18 22:14  lianliankan\lianliankan\bin\Debug\lianliankan.vshost.exe

     文件        490  2012-06-06 02:06  lianliankan\lianliankan\bin\Debug\lianliankan.vshost.exe.manifest

     文件      22196  2013-04-18 22:17  lianliankan\lianliankan\GameForm.cs

     文件       7989  2013-04-17 19:41  lianliankan\lianliankan\GameForm.Designer.cs

     文件       5817  2013-04-17 19:41  lianliankan\lianliankan\GameForm.resx

     文件       4668  2013-01-28 22:15  lianliankan\lianliankan\lianliankan.csproj

     文件       1861  2013-04-17 19:41  lianliankan\lianliankan\MainForm.cs

     文件       4400  2013-04-17 19:40  lianliankan\lianliankan\MainForm.Designer.cs

     文件       5990  2013-04-17 19:40  lianliankan\lianliankan\MainForm.resx

     文件       5420  2013-01-23 19:28  lianliankan\lianliankan\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       6332  2013-04-18 22:12  lianliankan\lianliankan\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       3589  2013-04-18 22:14  lianliankan\lianliankan\obj\x86\Debug\lianliankan.csproj.FileListAbsolute.txt

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

评论

共有 条评论