i understand how to program, but not how to build anything.
Posted by Pretend_Connection52@reddit | learnprogramming | View on Reddit | 81 comments
id like to make a game, but even though i understand all the basic programming concepts, i still cant really program something like snake, or pong, because i get stuck on issues very early on and cant figure out a way to solve them.
how do i get over this and start building things?
marsman57@reddit
If it makes you feel better, I've been developing software for 20 years and I'm very good at creating business software and know a good bit about machine learning.
I don't have the vaguest idea how to create Pong from scratch. Fortunately though, I do know that it has been done many times and I can find many implementations. I would find one and then go from there in making it my own.
deleted_by_reddit@reddit
[removed]
Feisty-Magazine7074@reddit
For games i can give you a little idea how to start: start with a player who moves with D and A (if u want also W and S key). And then you create a field with some logic so you can‘t move out. Now you optimize and start getting creative (like if he hits the wall 3 times -> freeze or say smth - just do something in action). So you start getting More Knowledge about logic and arrays/fields. After you did this, you implement more and more. Like some „enemies“ etc. And maybe a health bar if you hit 3 times game over, just start with little things and get creative. If you think about the whole game, it will be rlly hard to start code
Sad_Quote1522@reddit
Make a design document for whatever you are trying to do. What goes into a bare bones game console output game of snake? My list of elements might look like this:
A grid to move around on
Food for the snake
The snake
A score display
Think about what functions and classes you might need to write:
Controls
Adding to the score
What happens when the snake eats food
What happens when you hit yourself or the edge
jlanawalt@reddit
Part of the effort when programming isn’t just knowing how to write code, it is understanding the domain of the problem.
Maybe you get stuck because of coding skill, but maybe you lack the experience and vision with game development. If it’s the latter, read some books on game development and find some example code to learn from.
M_R_KLYE@reddit
Take what you want to build and cut it into the functions you'll need to build to accomplish the larger part..
Then take the logic of said functions you need and start writing it.
Any moron can code in my opinion.. It's the actual software engineering / coming up with things "from scratch" that separates the junior devs from the senior guys.. This being said none of the coders I've taught or known iniitally can write whole apps themselves unless its small scripts or bots.. Large projects such as games take MONTHS of figuring out all your parts to build.
Game design itself is a whole different bag..
asero82@reddit
Believe it or not, even simple games like Pong or Snake can be quite challenging to program when you're starting with only basic programming knowledge and no prior game development experience. :)
I mean, you need to manage user input, player status, movements, enemies status, positions, projectiles, score, menus, everything, everywhere, all at the same time...
Start with simple games like guess a number or paper rock scissors. Then add a menu, then add a Best Score Screen, and so on.
You also will have to look for game programming books, tutorials and/or watch something like this Code it yourself - Tetris, Code it yourself - Retro arcade racing game. Code it yourself - Tetris, Code it yourself - Retro arcade racing game.
You could also start by using a game engine like Godot or a similar one and following their tutorials. However, I believe it's generally better to understand the underlying principles before relying heavily on libraries or frameworks. This deeper understanding will ultimately enrich your game development experience.
Set yourself a goal that it's difficult for you but acchievable. In the end, what's important is to have fun in your learning adventure. "If is not difficult then you're not learning some new".
_seedofdoubt_@reddit
You say you've done projects, but have you done any projects without a tutorial?
inbetween-genders@reddit
Tell us “how you learned to program” we might be able to tell you what is going on.
Pretend_Connection52@reddit (OP)
i did all of the C projects on the cs50 course, and i did the helsinki java mooc up to part 13.
also messed around with some other code stuff but nothing project worthy.
Lostpollen@reddit
Clone the popular Linux commands like cat, ls, grep etc
PurpleSparkles3200@reddit
*Unix.
Lostpollen@reddit
...
PurpleSparkles3200@reddit
Unix commands. These utilities existed a good 20 years before Linux became a thing.
CodeTinkerer@reddit
Congrats!
The problem you have is you want to build a game, even a simple one, but one that has motion. You could start with much simpler games (Hangman) that are boring with no graphics. Or you can learn the math behind games with motion.
If you were majoring in computer science in a four year university, then a game programming course would likely happen in the fourth year. That's after taking at least half a dozen programming and math courses. Game programming often requires learning linear algebra, at least, the kind that involves simulating 3D.
You might check out Processing. This is basically Eclipse with Java and some graphics library built in. Java usually starts with a class and a main. Processing had some other starter functions. Maybe learn that. Coding Train's (YouTube) early videos focus on visual aspects of Java.
The reason game programming is a fourth year course is working with the math and not using any game engine tools (though that might differ from course to course).
I would look at Processing, but otherwise, all that math would be additional stuff you need to learn.
WickedProblems@reddit
It is probably going to take several years of just messing around and/or work experience before you can put anything tangible together that isn't tutorial hell.
That's just the reality regardless of you understand code or not.
C_umputer@reddit
Sounds like a good advice, will doing a very small project be a good first step?
Max_Oblivion23@reddit
Its still good to have one larger overarching project... but use smaller confidence builders from time to time... or create components independently from the main project... then try to merge it into the main project where it works as intended.
astasdzamusic@reddit
Yes, just do projects as much as you can, that are maybe pieces of an ultimate end goal project.
C_umputer@reddit
The problem is, it can be hard to come up with easy project ideas. I already did most of the stuff I was thinking about like Prime finder, Perfect number finder, A simple game bot etc.
astasdzamusic@reddit
Well why are you learning to program? Do you want to make games? Websites? Robots? Machine learning/AI? What got you interested in learning to code?
C_umputer@reddit
I honestly just enjoy figuring out how things work and solving problems. Currently, I just do leetcode and want to learn C
astasdzamusic@reddit
If you really enjoy solving problems, read the book The Structure and Interpretation of Computer Programs and do the problems in there. There’s JavaScript and Python editions but the original Scheme. Even if you only do the first chapter or two it’ll melt your brain a little and you’ll learn problem-solving techniques
Alternatively, just try to rewrite some application you use every day in your main language. You may not necessarily be able to do it perfectly but in trying you will learn a lot.
oliknight1@reddit
I had this problem too, but one thing i’ve been doing recently is just remaking simple versions of things I use everyday, recently i’ve done a HTTP implementation, and built a package manager.
Both of these seemed difficult at first because I had no idea how they worked but if you just focus on one small aspect of it and build from there it becomes much easier. For example with the package manager, I started with just downloading a dependency tarball and unpacking it, from there I went on to read and parse a package.json file to get the versions, then i moved onto parsing semantic versions etc etc.
Very long winded but find something you’re vaguely interested in understanding and just start doing it even if you have no idea how it works
Max_Oblivion23@reddit
And even if you are very skilled, you still have to follow certain constructs and methods to achieve some things and there is an initial phase or making the core components work fine and get good control over the flow before you can start building for real.
Ok-Yogurt2360@reddit
Sorry but this is not really true. If you get stuck like this it is most likely that you are learning the wrong underlying skills.
In order to get out of tutorial hell it will probably be best to go back to the bare basics and try to make some small projects. The key is to learn how to create simple pieces of functionality and to combine those into more complex pieces of software.
Afterwards you have to learn the opposite. How to break down a bigger project into smaller projects, and those into even smaller projects until you reach a problem you can solve with the fundamental knowledge of programming.
optical002@reddit
Not really, just focus on building and learning second, it will give immediate results which will motivate you.
It’s really easy to just get a hello world application and then tinkering it to see how things work.
Max_Oblivion23@reddit
I learned Lua and methods from the reference manual.... then I made folders named with the components I want to make, gamestate, sceneswitch, canvass, input_handling... and the I fill the folders with files that carry out the functionality I envisioned for it.
It helps to make a sort of a map with markdowns and sort your notes into potential file structures.
eldenpigeon@reddit
Build smaller things. Games are just a series a tiny things that make up a massive thing.
Economy_Monk6431@reddit
read the source code.
Own_Attention_3392@reddit
Learn how to articulate your problems clearly. Being able to explain what you don't know or understand is the first step to being able to ask someone else or a search engine. Say you're trying to implement pong. What's the first problem you have with implementing it?
Prudent_Glove_8960@reddit
Seems like i face something similar, not good at technical stuff,maybe, but we are attempting at working in a team atmosphere and trying to build something while doing, I can collaborate with you, but we need more people who can contribute to help us.
Solo_Entity@reddit
That’s how i felt leaving college, and how i still feel. All i made so far is a calculator
No_Record7125@reddit
https://www.youtube.com/@joshgeissler
connorjpg@reddit
If you want to make a game you will likely be heavily relying on a 3rd party library or a game engine. The later uses code but truthfully the engine itself could take years to learn. If you want to start small look to PyGame for documentation.
alternyxx@reddit
^ This.
alternyxx@reddit
Just start on whatever game idea you have! Look into game engines or libraries, read the docs and just try experimenting. It'll be a very frustrating time period but with enough persistent, it should be aokay! I also see that you mentioned you did the C problem sets in cs50. While I did also do the same, for cs50p (a python course), I really wanted to make a simple rhythm game and so I did and I spent 2 months on it!
pixel293@reddit
You can only become an expert at something by doing it. Just push through, don't expect your code to be perfect or pretty. Just focus on what you need the program to do next. Perfect and pretty come later.
2createanewaccountus@reddit
I find there's a plorthera of intro/basic/beginner programming tutorials, but few that actually teach how to break down user/project retirements into a lists of tasks/how you're gong to structure your code.
They just start , some copy/paste pre-made code without explaining the why of things.
So that's good to practice : break down your game into smaller bits of information, what you want things to do, how to do them, ect
Decent_Meringue3151@reddit
I have a couple ideas that might help you.
First, think about programming as if you're trying to explain how to do something, to a four or five year old. Go younger if you need to. Basically you're dealing with an entity that knows how to communicate, but everything else is completely alien. Like those videos of kids trying to tell their dad how to make a peanut butter and jelly sandwich and he takes every instruction literally. That's what it's like trying to program.
Secondly, pick one thing that you think is easy enough to work on and finish, and sit down and try to create it manually. Again think about doing this with a young child and trying to explain the rules of how the game works to them, so that they can follow it.
Using Snake as an example you might bust out a checkerboard and use the black pieces as the snake and the red pieces as the apples. Think about absolutely everything you would have to create as a rule in order to make that work, and write it down. This will effectively be your pseudocode. You'll probably miss some things just because you're going to make assumptions due to the fact that it's not intuitive just how pedantic you have to be when it comes to these things. Don't get frustrated about that, just keep practicing. You can even go back to the board if your program isn't working the way you think it should and consider what rule or instruction you might be missing in your code.
justUseAnSvm@reddit
You just have to start, and persist through.
In the beginning it's hours of banging your head against a keyboard.
Pretend_Connection52@reddit (OP)
the main issue is that i feel like a fraud. for example, when i struggle trying to figure out how to make a sprite move smoothly, i start googling but i get afraid to copy paste and i cant come up with a genius math solution on my own to make it work, and i dont know how to calculate frames either but googling that also makes me feel like a fraud.
luddens_desir@reddit
You can look up lerp functions online for moving things. :)
MrMagoo22@reddit
Code terminology is human created. We made it up. All of it. Expecting to know what some other random human decided should be the standard implementation for some feature or mechanic without looking up the documentation is equivalent to attempting mind reading. Coding is literally having an idea for something you want to implement, googling like crazy to figure out how the code does that thing, and then doing that thing. The second step is very important, and you're not a fraud for doing it, everybody does it.
tms102@reddit
Why do you feel like you need to reinvent the wheel?That's not a productive approach.
optical002@reddit
It’s fine to copy paste code, just try to understand what your pasting and how it works, eventually it will pick up and you’ll make your own decisions.
What you lack now is experience, now you need to immitate and understand to get experience, later on that knowledge will build up and you will start making your own decisions.
Key point is to understand what your copying, why is it like that, thats the main thing to get out of fraudness and build confidence.
For example you want to know how to move player in unity.
You get an answer like “add some value to transforms position x, to move left or right”
You then can start reasoning with it “whats a transform?” - “oh its a point in space, which has position rotation and scale, by changing its position my player can move”
So you current knowledge is “to move player, i need to change transforms position”
Then by researching or for fun looking how other people move player, you might discover “add force to rigidbody component”
When your knowledge clashes you can research it to update your knowledge“Why should i do it on rigidbody and not transform?” You might ask. After researching you find out that “oh by adding force to rigidbody it also smooths out collisions, instead of just changing transforms position, where it can teleport inside a collider”
And now you have just updated your knowledge to use rigidbody instead of transform.
By researching why it is done in that way, and having strong reasoning, you will not feel like a fraud, but like an expert when enough knowledge with reason accumulates.
iOSCaleb@reddit
Have you ever played a game of snake? Most versions do not have smooth animation. Heck, even Centipede didn’t really have smooth animation — it just hid behind fast moving objects.
Get your snake game working any way you can. If you move the snake in increments of a whole body segment at a time, that’s fine. Worry about improving the animation once you get the thing working. Programming really gets to be fun once you have something that works and you can start improving it, because once it’s working you can see your progress better.
There’s an idea in Agile programming called the MVP, or minimum viable product, which is basically the simplest thing you can build that still has some value. Whatever you want to build, aim first for the MVP. Once you get that working, you’ll feel a sense of accomplishment, and then you can start improving it one step at a time.
KlootViolin@reddit
That I think is literally how coding works. No need to re-invent the wheel.
First-Ad-2777@reddit
BTW Googling and even AI is fine, just depends what you used it for . Why matters.
If I’m looking at a software library, and I can’t find a code usage example, AI to the rescue. It’s not prod ready but I can zoom in on the docs.
BUT DONT TRUST Google or AI results. Take that information then cross reference all of it.
First-Ad-2777@reddit
Fraud? He’ll, I feel that way about me too. I’ve been in tech for 30+ years.
If you ever feel like you know it all, you did the same thing for too long.
“Imposter syndrome” is common in tech.
plastikmissile@reddit
Googling stuff is completely fine. Everyone does it, including veteran programmers with decades of experience. However, don't just copy/paste code. Make an attempt to actually understand how it works before typing it in yourself.
ChefBoyRBitch@reddit
I'm like you. I have 1 year experience. My strategy is to break it into parts. For example, for snake, draw a grid, draw the snake, control the snake, draw the food, append the snake. I know how to draw a grid, move the snake along the grid, draw the snake, draw the food, but i don't understand how appending it will work and I might be able to get the food to spawn in a random spot. So I can do the parts I know on my own. Then I can use ai to help me finish. Now I know how to make snake.
Here's the most important part. Now that ai has taught me. It's important for me to make it again on my own. This time I'll clean up the code using things like classes and functions where I didn't before. I will not use ai to build it a second time unless I absolutely have to. Afterwards if I feel confident I will move on to another project. If not then I will make it a third time.
armahillo@reddit
in the sidebar, under “new? read this” there are a bunch if links to posts that answer this question
AdDelicious2547@reddit
Writing on paper what I want to do helps me to know what concepts I need to think through before I start to code.
WystanH@reddit
Programming, more than anything, is the art of breaking big problems into smaller, solvable, problems. Trying to conceptualize even your snake game in final form isn't possible as code. Figuring out some discrete bit of code that the program will need, however, is how it's done.
Start with state. All programs are essentially about mutating and viewing state. What do you need to know about a snake? Head, length, where all the bits are? So, how to store all those things. Perhaps a bunch of (x,y) positions? Given that state, what does a move look like, etc.
I write tic-tac-toe for fun. It's the first project I'll do in a language I'm learning. It's something I might do when I'm bored. The game has a simple state; nine positions each with three possible values. From that, all other info can be derived: winner, turn, done, next player. A computer player is simple yet satisfying. Start with that and see how you do.
Programs don't appear fully formed. Development is an iterative process: make this happen, now I need this to happen, it would be great if this also happened... Start small and be nice to yourself. Being able to just launch into writing a program comes from experience and even then it can be a challenge.
Hamburgerfatso@reddit
If you have the programming "micro" skills decent but not the "macro" ones, project tutorials (e.g. websites, games or whatever else you want to make) would be worthwhile to you. They'll show you how the big pieces fit together and you'll find you can get an understanding of these components very quickly so you can make your own things afterwards.
PumpkinTittiez@reddit
Try building a simple game with Perlenspiel - https://perlenspiel.net/
Zealousideal_Baby377@reddit
Learn by building , when you get stumped , ask an engineer
GeneralPITA@reddit
Deconstruct the problem - Instead of seeing it as a game, look at it as architectural pieces. You have some pictures, some code that moves the pictures, some code that makes the movement look "smart" and some code that stores the pictures, high scores, maybe a user name associated with the high scores. Each piece gets broken down into code you can probably write.
I like backend programming, so I'll focus on making the movement look smart: Images move as a function of time, so some code does the left, right, up, down across the screen stuff, some code for boundaries (does a player go off the screen on the left and appear on the right, or do they bounce?), other types of collision detection, interaction logic - remove stuff from screen when it gets eaten or destroyed, and acknowledge when a scoring event has occurred, incrementing the score. Depending on the game, this might be a little different, but hopefully it illustrates the point. Then the important piece, how do the pieces talk to each other? getting images from storage, moving the image when a specific key is pressed, starting and ending the level or the game.
It's all just variations of the same idea. Business applications aren't much different. Code collects user input, stores it, provides logic based in more user input, stores the logic, etc.
Any thing more detailed than this should be a tutorial where specifics for the type of game could be discussed.
Based on your question, look into architecture and software design patterns rather than how to write code.
xiscf@reddit
Start by creating diagrams, write on a sheet how things are supposed to work. You will have a visual map to understand the interactions. Then try to found names for major functions of your game, use placeholder for things you don’t know how to name and refactor when you have decided. Don’t forget the sequence diagram. Writing code is the last thing you do. But yeah, nowadays people just start writing code without any plan…
mikefever90@reddit
this.
brettisstoked@reddit
u ask claude or chat gpt. its 2025 bro
Pretend_Connection52@reddit (OP)
i dont want the AI to program for me
Born_Material2183@reddit
You aren't asking it to do all the work for you but you clearly don't know enough to go about it on your own. Use it as a teacher. Ask it all your questions. Copy paste your code in and ask how to improve it (take its suggestions with a grain of salt, it doesn't have the full context)
First-Ad-2777@reddit
Then don’t let it.
Look at the AI code then open a new window and RTFM every line of code AI used. Now close the AI tab.
All you have left are the docs for the functions you may want to use (AI did).
Breaking down your problem into smaller processable pieces is more programming than writing actual code.
octahexxer@reddit
Ive seen books that guides you to build games.
Pale_Height_1251@reddit
The first issue you get stuck on, what is it?
yarusn@reddit
start small. make a text based 'rpg'. don't worry about balance. just give the player health and some attack value. have them enter fights with constantly spawning monsters until they die. the combat system? you get asked press 1 to attack, you press it. that's it
now add xp. maybe you level up after some xp. again don't worry about balance. you're just learning. now add different types of monsters. add another stat. maybe add loot. there's a lot here to play with. and it will teach you how to think of systems you can put together to make something work
optical002@reddit
Because you not only need programming basics, but also know framework knowledge how something builds, and programming is a tool which operates frameworks which build stuff.
In game example, first you choose a framework, aka game engine, like unity, unreal or godot or etc.
Then learn how this framework works and try building a hello world application.
For example if you know unity does not mean you know unreal, some concepts can transfer but mostly its different knowledge.
So my advice: pick up a framework and start learning it.
First-Ad-2777@reddit
Also, manage your scope. Write these games in text mode, before thinking about graphics. Do one thing new only.
Because you can’t both learn game logic AND graphics libraries both at the same time. You’d need exceptional patience and skill.
Glad_Dimension_2217@reddit
As someone who is finally developing portfolio projects for the first time, I can relate to the dread you are experiencing. I have just over two years of experience doing LAMP stack development, but never did anything outside of work to improve. I wanted to change that and came up with three high level projects for each programming domain that I find interesting. I’ll be lucky to finish half of these in a couple of years:
Web | Desktop | System
Web (PHP stacks): 2D Tank Game, Chess.com clone (stripped down), Graph data structure visualization tool using Three.js.
Desktop (C++): Scientific Calculator, Isometric Pixel Art Tool (stripped down), some other one I can’t remember (I’m in my garage).
System: Database Engine, Rendering Engine, Windows Kernel Device Driver.
Do the above (pick projects within domains that you want to get hired in/build in - for you, that’s a game), get a pen and some paper and write down the goal or feature set of each. Then, identify your tools (programming language, framework, libraries) and get comfortable with their APIs.
And just start man.
You can always pickup syntax and usage patterns of libraries from example code, and you should feel no guilt about using it to guide you when starting out.
To become an even better researcher and problem solver, try to use the documentation for these tools ONLY. Seriously, avoid StackOverflow, AI, etc. All the old heads had books, manuals, white papers, flowcharts, and the guy sitting next to him.
If you’re building from scratch: read books, blogs, watch quality videos and treat it like a subject in school. Take notes, code, troubleshoot, fix, etc. Once it works and you think you understand it, try the Feynman Technique and see how much you remember. If you don’t, go back and do it again. Then, write your blog. Make sure to give credit to the resources that helped you along the way.
First-Ad-2777@reddit
It sounds more like you’re not inspired. That’s ok.
Find a write up on one of these small apps, then slowly implement pieces and test as you go. By write up I mean, an article, analysis, or read some code if you have to.
Write notes before you code. What’s your objective? What corners can you cut for now (fill in later). You want to iterate and test in small pieces. Don’t try to do too much all at once.
iamevpo@reddit
Maybe do the projects you understand - can you make a tic-tac-toe command line game? Can you make a word guessing game like hangman? Moving pixels around for video game is quite hard, it is wrong assumption that it is good learning project, neither it is good to evaluate yourself based on such projects. Instead of "build anything" look around of small things or parts of algorithms you can build and refine them.
SmallPlayz@reddit
Use Google
GoldGlove2720@reddit
Yep but don’t literally google “how to build a snake game”. Google something like “how can I program keyboard input to controls a pixel” and expand on that yourself.
Very few people can program without looking things up.
Signal-Lucky@reddit
Start small and break problems into manageable steps. Focus on one feature at a time, like player movement or collision detection.
saturn_since_day1@reddit
My first game was pong, made in visual basic using buttons, and the like, in ways they weren't intended to. This was during just a few months of programming class in highschool.
If you understood basic concepts already, you could figure out something like snake or pong without a problem.
What is it you think you know? Because if you can't take a game as simple as those and turn it into code you are missing the biggest part of programming basics: how to translate an idea into code.
Think about how you would get something to act that way, and build it using the basic tools you understand. You have to just think it through and do it.
Mother_Committee_625@reddit
I too struggle with this. I’ve noticed I’ve gotten better at identifying various components of the idea, as I have implemented more projects. Struggling with finishing the projects is definitely another artifact that might occur based on your habits. These are just natural parts of building your ideas. Start small and iterate. Keep at it!
OriahVinree@reddit
youtube. Choose a project, Find a tutorial. There would be hundreds of tutorials on how to make pong, frogger, asteroids, snake.
Pick one thing, pick your tool, make it. Don't stop, don't give up. Figure out exactly where you're stuck and research. You're not going to learn unless you push yourself through stuff you don't know.
dmazzoni@reddit
I disagree. Following a tutorial just shows you one way that someone else did it. You'll never learn anything if you just do that. It's called "tutorial hell" for a reason.
To really learn, you have to figure out your own way to do it. You have to get stuck, then figure out the problem, and then get un-stuck.
OriahVinree@reddit
I wasn't very clear. I meant more follow the design patterns, how to structure things, the thought processes. When building a game, what comes first, then what, then what. Don't follow the code, follow the process.