I have tried to look at other programs, but I can't seem to understand them. I think I know what an array is and how to use it, but I have no idea how all of these other programs used it. The only thing that I can think would make sense to use arrays on is animation, for example when a button is pushed. Other than that, I can't figure out how everyone is using them. It looks way too complicated to figure out alone.
I also wonder how do you use geometry in these programs? I think I can make very, very simple games that don't require bg collision, so I not totally stupid on the subject. But, for example, I will look at a code for noise and other things, and I can't figure out how to programmer figured how what kind of math to use and when to get the desired affect.
Using geometry and how to learn from other programs?
Root / Programming Questions / [.]
Tiger2Created:
Personally, I've spent many years studying how other programmers used certain algorithms and functions to attain certain effects. It's a matter of time and experience. Years ago, I would have looked at someone's code and made gibberish out of it. Nowadays, I have confidence enough to review and understand that same code.
I will look at a code for noise and other things, and I can't figure out how to programmer figured how what kind of math to useokay so this is actually a really important thing to address I think a lot of higher-level concepts of programming use some genuinely weird math that takes years and years to learn. When you see it in a program it's really easy to be dissuaded--but the thing is, the person that used it isn't just a super genius that knows how everything will work instantly (usually) Most of the useful algorithms are things that have been developed by other people, verified, and then taught in school (or whatever) so no one else has to reinvent it. Even something like the Pythagorean theorem could take a while for someone to derive on their own. Instead, your algebra and geometry teachers drilled it into your head. But you didn't have to come up with it yourself. Likewise with noise algorithms. Someone spent a long time learning and thinking about things to come up with an algorithm like that so that other people don't have to. So it's okay to not really understand some of the math going on in someone's program. They've just memorized [the names of] more algorithms than you. Either you'll learn it eventually or it doesn't even matter, as long as you know what it means to your program. also thanks MZ952 for bumping this thread
Arrays are useful for tons of things, far more than an animation. In fact I've never used one for an animation.
I most often use them for things like list and inventories. So you can keep track of all the items and the quantities of each. The array index would refer to the item, and the value would indicate the quantity.You could even use one to simulate a gas tank. I used one in one of my games, and it correlated to the gas tank visual. So it checked the array and then showed the appropriate amount of fuel on the HUD. It also ensured that you couldn't overfill it.
I may have overcomplicated it, probably could've done the same without an array but it worked.
Arrays are useful for tons of things, far more than an animation. In fact I've never used one for an animation. I most often use them for things like list and inventories. So you can keep track of all the items and the quantities of each. The array index would refer to the item, and the value would indicate the quantity.You could even use one to simulate a gas tank. I used one in one of my games, and it correlated to the gas tank visual. So it checked the array and then showed the appropriate amount of fuel on the HUD. It also ensured that you couldn't overfill it. I may have overcomplicated it, probably could've done the same without an array but it worked.So things like that is what I don't understand out to use. For example, I'm working on a game and I have set up a few array only because I think I am supposed to, but I don't actually know what to do with them or how to use them to their most effective. I already know what the basic of an array is, though and how the index works (mostly).
Don't know what you meant by bumping Anyway, So how would I go about trying to learn these things? If I decide I want noise algorithms for a background, I wouldn't know how to start learning how to make one. I understand that it takes practice and time, but where do I start?I will look at a code for noise and other things, and I can't figure out how to programmer figured how what kind of math to useokay so this is actually a really important thing to address I think a lot of higher-level concepts of programming use some genuinely weird math that takes years and years to learn. When you see it in a program it's really easy to be dissuaded--but the thing is, the person that used it isn't just a super genius that knows how everything will work instantly (usually) Most of the useful algorithms are things that have been developed by other people, verified, and then taught in school (or whatever) so no one else has to reinvent it. Even something like the Pythagorean theorem could take a while for someone to derive on their own. Instead, your algebra and geometry teachers drilled it into your head. But you didn't have to come up with it yourself. Likewise with noise algorithms. Someone spent a long time learning and thinking about things to come up with an algorithm like that so that other people don't have to. So it's okay to not really understand some of the math going on in someone's program. They've just memorized [the names of] more algorithms than you. Either you'll learn it eventually or it doesn't even matter, as long as you know what it means to your program. also thanks MZ952 for bumping this thread
I'm kind of disappointed to say that experimentation is about the best teacher you'll have for this kind of field.
Programming and the implementation of routines and algorithms is independent from whatever language you've decided to learn; it's rather a way of thinking. What I mean by this is that once you learn how to "program," learning other programming languages is merely a task of learning the syntax and applying your preconceived notions of programming through that syntax.
That being said, learning a programming language is not too diverged from learning any other real language. It requires a lot of tinkering and trial-and-error to get it right, but once you've got your language down pat, it then becomes easier to understand other languages given you have rounded the ideas of grammar and assemblage of information.
It also takes a lot of retroreflection, or consolidating what you already know and attempting to find patterns or logic in its underlayers. During my learning process, I found that reflecting back on the way-of-things, regarding the syntax and structure I was learning, helped me uncover new perspectives and thus new methodologies for doing things. It's a self-constructive process.
Now, geometry and using other's code as a learning medium are widely different concepts. To cover the former, as Lumage said in his post a lot of geometry and general mathematics programmers use are actually crazy complex to understand, unless you spent years cramming those concepts in. There is no magic to it, and frankly it's hardly related to programming. It is in and of itself its own field.
To answer the latter, and I'd just like to point out that at this point I'm practically imagining what I would have told myself to do several years ago, to learn from other's code you have to tinker. To do this adequately, and to get something out of it, you more or less have to be a "good tinkerer." You have to know what it is you're trying to find, and then know in what ways you should go about finding it, else you'll be scrambling on a subject seemingly endlessly without progression. Most programmers make the effort to make their code "readable" to a certain degree, not just for others but for their own sake.
To wrap this post up, to learn from other's code you have to be willing to plagiarize. And I mean downright copy a good chunk of code and break it down into its constituents. This really relates to me because before I ever touched an IDE, I was an animator, and one of the main things that got me up and going as an animator was the study of other's animations, to the point where I was drawing and recreating their work. I've heard of others doing this in various other fields, example being writers entirely copying famous author's works to (I suppose) "feel what it's like to write great literature." Despite what school might have you do, plagiarism is a beneficial tactic for learning new and perplexing ideas.
I guess that's all I got. This is the most elaborated post I have on this site I'm sure. Hope I helped :)