Skip to content

mooict/Image-Slider-Puzzle-Game-WIn-Forms-MOO-ICT

Repository files navigation

C# Tutorial – Make a Image Sliding Puzzle Game in Windows Forms

Hi in this tutorial we will be making a Sliding Image Puzzle game. This game will be made using only windows form, C# and .NET in visual studio. We will not be adding third party framework to make this application or use any games engine such as Unity or GODOT. All of the components will be pure windows form and C# programming. Sliding image puzzle is a game I have been meaning to do in windows form because its one of the most requested and well-known game. Its not difficult to do but finding the right resources to do it is another question. For this tutorial we made sure to including all of the source codes and refactored the code to make it easier for beginner programmers to follow.

For this game, it won’t use pre-made sliced images instead it will use the browse feature to import an image to the application, crop the image to match the tiles in the game and then load them to a picture box. There is also a win condition in the code when you matched all of the pictures. At any time, you can load another image and play it through. In the code you will see we have a shuffle feature where it will shuffle the images when it loads so you can get right into solving the puzzle.

Lesson Objectives –

  • Create a simple slider image puzzle game using windows form, C# and visual studio
  • Work with a menu strip in windows form
  • Create and Load picture boxes from the C# script in a 3×3 grid
  • Assign tags to to each picture box so they can be identified as the game is played
  • Use labels to show the current position of the tiles and the win position of the tiles
  • Load the image into a bitmap and resize to match the game conditions
  • Crop the image to match each 130px tiles in the game.
  • Use multiple lists to save the images and the image positions into
  • Use custom functions and events in the game
  • Assign the win condition when all of the tiles are matched
  • Have fun

Video Tutorial - Click below to Watch this video on YouTube

Subsribe to the youtube Channel to create more project just like this one.

C# Tutorial – Make a Image Sliding Puzzle Game in Windows Forms

Releases

No releases published

Packages

No packages published

Languages