C# - I am trying to create a grid lock game and I need your assistance

187 views Asked by At

Since I don't have 10 reputation to post an image, I am going to leave a link of the game picture. http://thinkfun.com/mathcounts/play-rush-hour

This is what I want to create. A game where a rectangle must pass through other rectangles through the hole to win the game. The main rectangle can only move forward and other rectangles can move either right, left, up or down depending on their position. You must move the other rectangles in a way that they could make a way for the main rectangle to pass.

Here is my plan how I am going to create this game:

  1. Create all the forms, import all the images and graphics to get ready to work with them.

  2. Write code for 1 rectangle that would be able to move around.

  3. Write an algorithm that wouldn't allow for rectangles to go through each other.

  4. Make a winning hole.

  5. Code other rectangles, make a full game.

  6. Make fancy animations.

  7. Import statistics : score, move counter and etc.

Here are my questions that I wanted to ask before trying to develop this game.

(Oh, and by the way, I am using Visual Studio C# form )

  1. I assume that these rectangles are not going to be buttons, then what kind of a "button" (or whatever you call those extra features ) should I use?

  2. How do I make a skin for those rectangles? So I can make it look like wood and make a nice skin for the main rectangle.

These are all my questions so far. I would like to know how to overcome those problems and I would like to hear some extra tips. Thank you very much for your time!

2

There are 2 answers

4
Adam On
  1. Use Graphics to draw your rectangles. Else make an object to hold info for it and you can import an Image as your "skin".

  2. See number 1.

2
Daniel Hesslow On

First off: Do you want to create a game or learn winForms? If the answer is create a game. Chose a Game Engine (Unity is nice, and uses c#) and work with that instead.

If you want to learn winForms you'd probably want a PictureBox, then add your code your code in OnMouseUp, OnMouseDown, etc. Good luck :)