Simple Game with cells/grid?

yonett

New member
Joined
Dec 4, 2023
Messages
1
Programming Experience
Beginner
Hi all. I'm going to create a game using WPF. Unfortunately, I'm a newbie and I need some support. The game is similar to 1010! from GramGames, so for now I want to make a field that contains a cells, some kind of grid, and the rectangular figures that can be placed on this field.

I made some action plan:
1. Make a custom control called "cell" using button. Cells can be empty or not, so empty cells should be active, occupied cells should not. That means on active cells I can place some figures.
2. Make a custom control called "field", which contains a several cells. Actually field is a NxN matrix of cells, having a row and column numbers.
3. Implement a placement function which checks if certain figure can be placed on certain cell of the field, and place it.

Any advice is welcome. I need help with any aspect of development. If anyone is interested, I can give the code for the same game only for the console version, for better understanding.
Thank you
 
As with any programming task, it's a matter of recursively breaking down a problem into smaller problems, and then solving the smallest problem, and integrating the small solutions into bigger solutions.

You are mostly off to a good start by having your high level plan. I would caution you to think like a WPF programmer and keep the View separate from the Model and the game logic, unlike a WinForms programmer who will often conflate the three together.
 
Design your UI and design your data.

Try to design the UI; the XAML or whatever. Then ask for specific help when you need it. A good way to start is to describe the UI the way a non-programmer might. That can be called requirements. If you can describe everything as a non-programmer then that can help others help you. You say you want to use buttons. Why did you decide that? If you describe the requirements then someone might have a better suggestion.

Try to design the data. It will help others help you if you have some specifics about the data.
 
Back
Top Bottom