Click here to Skip to main content
Licence 
First Posted 25 Feb 2006
Views 19,255
Downloads 1,060
Bookmarked 7 times

Minesweeper

By | 25 Feb 2006 | Article
It is a game like Window minesweeper of microsoft

Sample Image - Net_framework.gif

Introduction

It is a game program like Window Minesweeper.Perhaps someone write their program like this. But I want to write agian.This is the first program of mine in C# and VS.Net, so it isn't really completely .I hope I'll get many opinions from people who read it

Using the Code

I use 4 main components to make this program 1:GraphicsItem 2:MinemouseEventhandler 3:mathbase 4:MineResorceSet

GraphicsItem
//
//It is some method
//
//
//constructor 
//
        public GraphicsItem(Image beginImage,int _Columns,int _Rows,int _GrItemWidth,int _GrItemHeight)
        {
//img is a Image of mine map
ResetAttribute(_Columns,_Rows,_GrItemWidth,_GrItemHeight);
            Img=new Bitmap(width,height);
            g=Graphics.FromImage(Img);
            ResetBeginImage(beginImage);
        }
//
//DrawItem in position x,y
//
        public void DrawItem(Image image,int column,int row)
        {
            g.DrawImage(image,column*grItemWidth,row*grItemHeight,grItemWidth,grItemHeight);
        }

MinemouseEventhandler
//
//This is class to decode MouseEventHandler of Winform to //Event-handler of this game
//
//
//sample method
//
        public void MouseMove(object sender,MouseEventArgs me)
        {
            if((me.X>=(MX+1)*_ItemWeight) || (me.X<mx*_itemweight)||(me.y />=(MY+1)*_ItemHeight)||(me.Y<my*_itemheight)) y="(int)(Math.Floor(me.Y/_ItemHeight));" x="(int)(Math.Floor(me.X/_ItemWeight));" />=0 && x<columns />=0 && y

class mathbase

It contains all method that processes property of mine map some method like makeminemap(),leftclick(x,y),...

class MineResourceSet

It is a class cotain all method read,write the set of game is load last game,and save new property

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Dau Quoc Chung

Web Developer

United States United States

Member

I'm a student ,from Viet Nam and 21 years old,i'm studying in Hanoi university of technology(H.U.T).I want to make friend to all people

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionIn Visual Studio 2010 Pinmemberbitcrushr23:24 16 Nov '11  
GeneralMy vote of 3 PinmemberToli Cuturicu14:46 20 Dec '10  
Questionwhat is wrong?? Pinmemberrashidotm5:36 3 Jan '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 25 Feb 2006
Article Copyright 2006 by Dau Quoc Chung
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid