資源簡介
里面注釋很詳細,界面不太美觀,功能都實現了,
有道具前進 道具后退1個 道具后退3 個 滾動條
游戲存檔 讀取文檔等功能。

代碼片段和文件信息
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.Threading?;
using?System.Media;
using?System.IO;
using?System.Runtime.Serialization.Formatters.Binary;
namespace?大富翁
{
????public?partial?class?Form1?:?Form
????{
?????????Random?rnd?=?new?Random();
????????int?is_click=0;//用于判斷是否要開始只篩子
????????int?num=0;//記錄隨機數
????????static?int?count=0;//記錄鼠標點擊次數用于判斷篩子的變化與停止
????????int?number;//得到的篩子數
????????static?int?current_postion;//當前位置
????????static?int?postion?=?1;//后來的位置
????????int?savepostion?=?0;
?????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?pictureBox35_Click(object?sender?EventArgs?e)
????????{
????????????label2.Text?=?““;//道具碰到開始行進的時候去掉文字提示
????????????count++;//點擊次數加1
????????????isclick(count);
????????}
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????if?(is_click?==?1)//點擊了篩子
????????????{
????????????????//從?1到6.jpg?總共6張圖片,在時間增加記錄數超過了6,重新設置為0使num變化值在0-5
????????????????if?(num?>=?6)
????????????????????num?=?0;
????????????????serve.Image?=?imageList1.Images[num];//顯示第0到5張圖片
????????????????lblNum.Text?=?(num?+?1).ToString();//記錄得到的篩子數
????????????????num?+=?1;
????????????}
?????????}
????????//針對坐標的人物移動函數
????????public?void?pmove()
????????{
????????????number?=?Convert.ToInt32(lblNum.Text);//得到篩子數
????????????int?move_length?=?number?*?6?+?(number?-?1)?*?50;//得到移動的長度
????????????//在原來的左邊距+50+長度為后來的位置
????????????if?(label1.Location.X?+?move_length?+?50?<=?556)//后來的位置沒有超過第一行
????????????{
????????????????label1.Location?=?new?Point(label1.Location.X?+?move_length?+?50?label1.Location.Y);
????????????}
????????????else
????????????{
????????????????int?have_length=0;
????????????????int?yhave_length=0;
????????????????if?(pictureBox10.Location?!=?label1.Location)//起始位置沒有在末端
????????????????//已經移動的步數
????????????????{
?????????????????????have_length=?(pictureBox10.Location.X?+?50?-?label1.Location.X)?/?50;
????????????????}
????????????????else//起始位置就在末端
????????????????{
????????????????????have_length?=?0;
????????????????}
????????????????number?=?number?-?have_length;//還剩下的步數
????????????????if?(num?<=?4)//不會出去y方向
????????????????{
????????????????????int?y_length?=?number?*?6?+?(number?-?1)?*?50;
????????????????????label1.Location?=?new?Point(pictureBox10.Location.X?pictureBox10.Location.Y?+?y_length);
????????????????}
????????????????else//超過了y方向
????????????????{
????????????????????yhave_length?=?(pictureBox13.Location.Y+?50?-?label1.Location.X)?/?50;
????????????????????number?=?number?-?yhave_length;//還剩下的步數
????????????????????int?x_length=number*6+(number-1)*50;
????????????????????label1.Location?=?new?Point(pictureBox10.Location.X-x_length?pictureBox10.Location.Y);
??????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-02-27?12:48??大富翁\
?????目錄???????????0??2014-02-28?08:38??大富翁\大富翁\
?????文件?????????917??2014-02-27?12:48??大富翁\大富翁.sln
?????文件???????22016??2014-02-28?08:38??大富翁\大富翁.suo
?????目錄???????????0??2014-02-27?20:10??大富翁\大富翁\bin\
?????目錄???????????0??2014-02-27?20:19??大富翁\大富翁\bin\Debug\
?????文件?????4865018??2014-02-27?19:23??大富翁\大富翁\bin\Debug\1.mp3
?????文件?????3094236??1998-07-07?21:40??大富翁\大富翁\bin\Debug\1.WAV
?????文件?????2938272??1998-07-07?18:57??大富翁\大富翁\bin\Debug\2.WAV
?????文件??????117760??2014-02-28?08:34??大富翁\大富翁\bin\Debug\大富翁.exe
?????文件???????48640??2014-02-28?08:34??大富翁\大富翁\bin\Debug\大富翁.pdb
?????文件???????14328??2014-02-28?08:34??大富翁\大富翁\bin\Debug\大富翁.vshost.exe
?????文件?????????490??2009-06-11?05:14??大富翁\大富翁\bin\Debug\大富翁.vshost.exe.manifest
?????文件???????13981??2014-02-28?08:27??大富翁\大富翁\Form1.cs
?????文件???????41809??2014-02-28?00:52??大富翁\大富翁\Form1.Designer.cs
?????文件???????67579??2014-02-28?00:52??大富翁\大富翁\Form1.resx
?????文件????????4089??2014-02-27?21:35??大富翁\大富翁\Helper.cs
?????文件????????3294??2014-02-28?08:38??大富翁\大富翁\login_in.cs
?????文件????????5902??2014-02-28?08:38??大富翁\大富翁\login_in.Designer.cs
?????文件???????77959??2014-02-28?08:38??大富翁\大富翁\login_in.resx
?????目錄???????????0??2014-02-27?12:48??大富翁\大富翁\obj\
?????目錄???????????0??2014-02-28?08:34??大富翁\大富翁\obj\Debug\
?????目錄???????????0??2014-02-27?14:35??大富翁\大富翁\obj\Debug\Refactor\
?????目錄???????????0??2014-02-27?12:48??大富翁\大富翁\obj\Debug\TempPE\
?????文件?????????556??2014-02-28?08:34??大富翁\大富翁\obj\Debug\大富翁.csproj.FileListAbsolute.txt
?????文件?????????966??2014-02-28?08:34??大富翁\大富翁\obj\Debug\大富翁.csproj.GenerateResource.Cache
?????文件??????117760??2014-02-28?08:34??大富翁\大富翁\obj\Debug\大富翁.exe
?????文件???????41502??2014-02-28?00:52??大富翁\大富翁\obj\Debug\大富翁.Form1.resources
?????文件???????48262??2014-02-28?08:34??大富翁\大富翁\obj\Debug\大富翁.login_in.resources
?????文件???????48640??2014-02-28?08:34??大富翁\大富翁\obj\Debug\大富翁.pdb
?????文件?????????180??2014-02-27?21:54??大富翁\大富翁\obj\Debug\大富翁.Properties.Resources.resources
............此處省略8個文件信息
評論
共有 條評論