#how do I start building project in c
28 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
I recommend your first game to be a terminal game, so that you can just print the text without having to worry about setting up any graphics libraries
Isn't part of the issue about the transition between text and graphics?
It all really depends on how much experience sgr19 has, which we don't know right now
I was assuming they have little
Hm. Maybe my advice would be to find a partially complete, or very small examples of game code, and dissecting that.
Let's wait on sgr19's response, cause we're flying blind right now
What we do know is that they're trying to learn C AND its graphics libraries, and a game has both of those at once, which can be challenging.
But you're right.
The first step is to choose a graphics library, since pure C can't do graphics without third-party libraries (SDL2 is good, for example). But you need at least minimal knowledge to use it (variables, ifs, loops, functions...). If you do, go read the tutorial 🙂 https://lazyfoo.net/tutorials/SDL/
A beginners guide for Game Programming.
Hi. I have not developed any small project based on graphics. Can you share the task or steps I shall follow so that I can start understanding complex code and even build my own. I have difficult time to grasp complex code structure, how do I overcome it?
I recommend your first game to be a terminal game, so that you can just print the text without having to worry about setting up any graphics libraries
It doesn't have to be something as relatively complex as pacman that has a huge map, powerups, ghosts with AI, and so on
I recommend starting with something like writing Snake in C
In this video I will demonstrate how you can write a simple Snake game in C with the ncurses library on Linux.
Installations (names of packages on Debian/Ubuntu):
- libncurses-dev
- ncurses-doc
You can view the code I wrote in the video over here: https://gist.github.com/nir9/c6d8cab0d0966ee593c1525bb8d4c119
Ok. Is it possible for me to build complex codes once I learned to develope the small projects?
Absolutely; when people want to climb the Mount Everest, they always start off conquering a small mountain, and then slowly build up to the legendary ones like Everest.
If you don't understand addition, you have no hope of understanding multiplication, and if you don't understand multiplication, you have no hope of understanding exponentiation
Thank you for your motivational words.
No worries, we're all here to help you out on your long journey that's ahead of you :)
@idle bay I always recommend using godbolt.org in order to learn any programming language, as it allows you to quickly test stuff without having to install and run a C compiler on your own computer:
https://godbolt.org/z/hzT946rTe
Ok. I often use pythontutor website to understand snippet of code. I will check it also
That's also a great website
@idle bay Has your question been resolved? If so, type !solved :)
'!solved'
without the quotes
!solved