r/csharp • u/Im_a_Duniel • 13h ago
Help Help with console game (beginner)
I have to make a console game on C# for my class and i thougt about making a hacking mini game like in Cyberpunk 2077, my question is how realistiv this would be since im really not that good at coding yet.
the Goal is to get all 3 hacks by picking a row and then of that pick another pick in the column and then the row of that pick again.
i hope this is somewhat understandable.
9
Upvotes
3
u/l2protoss 12h ago
Hard to answer this question without knowing how much of a beginner you are. If you’ve never written a program before that you’ve designed, this will probably not be trivial, but it’s definitely doable. You’ll likely make a lot of mistakes, but you’ll learn a lot doing it.
1
u/njtrafficsignshopper 12h ago
I recognized it from the screenshot! Looks like you're well on your way. If you want advice I would say one thing you have to put a lot of thought into is, how are you going to generate the puzzles while making sure they're solveable, not just how youre going to allow the user tosolve them
4
u/Pacyfist01 12h ago
This library can help you: https://github.com/tui-cs/Terminal.Gui
2
u/TheMeta-II 12h ago
You might struggle with the interface as a beginner, but the core gameplay should be very doable. There are multiple ways to go about it, but the easiest might be generating a nested list or array and creating a method that generates a few sequences based on some instructions.
2
u/jdl_uk 12h ago
It's totally doable in C#. Your biggest choice would probably be the UI framework, and you have some options depending on what you want to get out of it.
Think about whether the styling is important to you, and whether you expect to do game development or general application development in the future.
1
u/Haydara_1 12h ago
The idea is doable, you will just need a library to be able to manage the visuals
1
u/Slypenslyde 1h ago
I'd consider this a pretty hard challenge for a beginner. You don't get better if you don't stretch, but this might be too big a stretch.
What will help is to realize that programs can be described as lots of small pieces of code working together. This is how people deal with huge programs with hundreds of thousands of lines of code: we see them like a watch made of mechanisms that are made of gears and other small, simple components.
So maybe first try to display a grid of characters like you want.
Then try to make it so some characters have a cursor around them.
Then figure out how to move that cursor when you push one button.
Then make the other buttons work.
I'm assuming you have to swap some items some way: once you can move the cursor try to make it so another button does the swap.
Then you can work on checking the board after the swap to see if the player "wins".
Each of these will seem pretty hard, but you have to do all of them to make the program work, and there aren't many different orders you can do them. If you can't display the grid it doesn't make sense to try and do cursor logic. If you can't do the cursor logic it doesn't make sense to to the swap logic. If you can't swap items, there's no sense to checking for win conditions.
It may be too ambitious, but if you have 2-3 weeks and crack at it 3-4 hours every day you might get there depending on how hard you focus. Realistically: you may want to start smaller. You'll probably get the same grade for a "guess the number" kind of game, so risking failure doesn't make a lot of sense. One of the ways to survive in school is to do "safe" assignments and save your ambitious ideas for fun. How I worked in college is I'd rush to finish a simple project that I figured would get an A, then if I finished fast enough I'd work on something more fun. If I finished the fun thing I submitted that. If not, I submitted the safe thing.
But school's weird. One time I got ambitious and took my assignment very far. My teacher gave me a 60 out of 100 for "doing too much" and called it "not following directions".
•
u/crashonthebeat 1m ago
For terminal stuff look up ansi codes. You can basically control the position and color of text just with those.
Build a class that will append those ansi codes into strings and swap them out to change color and position. For this, the only thing that's gonna change is your background colors really.
It's not too difficult but take your time and build it step by step. Build the basic layout first just with ansi coded strings, start adding color, then controlling where the colors are from user input. Then you can merge the ui and logic together.