- 25
- 0
- 约2.17万字
- 约 15页
- 2017-11-29 发布于湖北
- 举报
连连看游戏源代码C#
连连看
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections; //ArrayList命名空间
namespace 连连看
{
public partial class Form1 : Form
{
private Bitmap Source; //所有动物图案的图片
private int W = 50; //动物方块图案的宽度
private int GameSize=10; //布局大小即行列数
private bool Select_first = false; //是否已经选中第一块
private int x1, y1; //被选中第一块的地图坐标
private int x2, y2; //被选中第二块的地图坐标
Point z1, z2; //折点棋盘坐标
private int m_nCol = 10;
private int m_nRow = 10;
private int[] m_map = new int[10*10];
private int BLANK_STATE = -1;
public enum LinkType {LineType,OneCornerType,TwoCornerType};
LinkType LType; //连通方式
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Source = (Bitmap)Image.FromFile(..\\..\\res\\animal.bmp);
this.pictureBox1.Height = W * (m_nRow + 2);
this.pictureBox1.Width = W * (m_nCol+2);
this.pictureBox1.Top = 0;
this.pictureBox1.Left = 0;
//当前窗体标题栏高度
int d = (this.Height - this.ClientRectangle.Height);
this.Height = this.pictureBox1.Height + this.pictureBox1.Top+ d;
this.Width = this.pictureBox1.Width + this.pictureBox1.Left ;
//for (int i = 0; i 10 * 10; i++)
//{
// m_map[i] = i % 6;
//}
StartNewGame();
Init_Graphic();
}
private void StartNewGame()
{
//初始化地图,将地图中所有方块区域位置置为空方块状态
for(int iNum=0;iNum(m_nCol*m_nRow);iNum++)
{
m_map[iNum] = BLANK_STATE;
}
您可能关注的文档
- 连接器及组装之基本认识.ppt
- 连接成形基础-待改.ppt
- 连杆-机械制造工艺课程设计..doc
- 连杆工艺及夹具设计2.doc
- 连杆盖零件的加工工艺及夹具的设计说明书5.doc
- 连杆类锻件生产技术.ppt
- 连铸过程(全).ppt
- 连铸题库综合题2设备.ppt
- 连锁企业信息管理第一章.ppt
- AI+具身智能行业市场前景及投资研究报告:体育安防场景落地.pdf
- 广东省广州省实验中学教育集团2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州大学附属中学2025-2026学年八年级上学期奥班期中物理试题(解析版).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(含答案).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(解析版).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 2026《中国人寿上海分公司营销员培训体系优化研究》18000字.docx
- 《生物探究性实验教学》中小学教师资格模拟试题.docx
原创力文档

文档评论(0)