您好,欢迎光临本网站![请登录][注册会员]  
文件名称: C#拱猪游戏源码
  所属分类: C#
  开发工具:
  文件大小: 362kb
  下载次数: 0
  上传时间: 2014-03-19
  提 供 者: oysd****
 详细说明: C#拱猪游戏源码,,源码,可运行.部分源码: private void InitializeLocations() { List allLocations = new List(); allLocations.Clear(); int getRandNumber = rand.Next(1, 17); allLocations.Add(getRandNumber); spaceLocation = getRandNumber;//设置空白位置 for (int i = 1; i < 16; i++) { while (true) { getRandNumber = rand.Next(1, 17); if ((getRandNumber != spaceLocation) &a mp;& !(allLocations.Contains(getRandNumber))) { break; } } ControlLocation cl = new ControlLocation(); cl.LableNum = i; cl.LocationNum = getRandNumber;//5~1|a|s|p|x clList.Add(cl); allLocations.Add(getRandNumber); } //循环设置每一个lable位置 foreach (ControlLocation cl in clList) { int lableNumber = cl.LableNum; int locationNumber = cl.LocationNum; string getLocation = locations[locationNumber]; string[] locationArray = getLocation.Split(','); Label lable = (Label)this.Controls["label" + lableNumber.ToString()]; lable.Location = new System.Drawing.Point(int.Parse(locationArray[0]), int.Parse(locationArray[1])); } Invalidate(); } private int SelectLocationNumber(int lableNumber) { int result = 0; foreach (ControlLocation cl in clList) { if (cl.LableNum == lableNumber) { result=cl.LocationNum; } } return result; } private string[] getDetailsLocation(int index) { return locations[index].Split(','); } private void Cell_Click(object sender, EventArgs e) { Label lab = (Label)sender; string lableNumber = lab.Tag.ToString(); int getClickLableNumber = int.Parse(lableNumber); //判断是否可以移动 bool bCanMove = JudgeCanMove(SelectLocationNumber(getClickLableNumber).ToString()); if (bCanMove) { int getLocationNumber=SelectLocationNumber(getClickLableNumber); if (getClickLableNumber != 0) { string[] getLocationsSpace = getDetailsLocation(spaceLocation); Label labWillMove = (Label)this.Controls["label" + lableNumber]; labWillMove.Location = new Point(int.Parse(getLocationsSpace[0]), int.Parse(getLocationsSpace[1])); UpdateClList(getClickLableNumber, spaceLocation); spaceLocation = getLocationNumber; } else { MessageBox.Show("没有找到对应位置为0的!"); } } } ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: C# 游戏 源码
 输入关键字,在本站1000多万海量源码库中尽情搜索: