I can't bash my courses or degree, because it was my own fault for falling for their BS. I now have a BS in Game and Simulation Programming and yet my programming still sucks. Now my confidence is gone so I sit around coding simple things. I find I don't have the drive to do advanced things because of how things have played out lately. It's amazing our one little bump in the road can totally mess up your confidence.
50% joking, but CS professors seem to be the ones who couldn't cut it in real world development.
50% joking, but programmers in most software companies seem to be the ones who couldn't cut it in real world scientific research. I'd go even further - most of them couldn't really cut it in real world development, too, if you exclude trivial and boring business applications moving data around from the backend to frontend and vice versa.
And more seriously, I know of many professors or PhDs doing real world development. Actually it is a serious problem for universities here - instead of doing scientific research (low paid) they work for software companies (much better paid).
Here's another wild theory, programmers working for software companies prefer real world development and programmers who do scientific research prefer scientific research! It's not a matter of being incapable, just personal preference, huzzah!
The problem is that so many universities hold the CS students hands so they don't really learn anything. Others are so eager to get into programming because they want to make games that they jump at any Uni offering a 'game programming' degree. This doesn't work because having your hand held 100% means you don't know what to do when you are on your own. Though, if you start from scratch and learn on your own you run into the issue of not knowing what to code due to there being no real path for learning (unless you consider the pull a project out of air and hope it is just advanced enough to push you but not too advanced to discourage you).
For example, in my DeVry GSP degree it was set so that the intro course was C# (learn data types, input/output, functions, defines...real minimal basics) the advanced course was C++ and the entire course focused on nothing but classes (declaring, composition, inheritance, constructor/destructor). The computer architecture had us learn assembly (using Emu8086) which I liked learning but never used it after the course. The rest of the courses had us using the Torque products (Torsion, Torque Game Builder, Torque Game Engine, and Torque Game Engine Advanced). I finished my degree and my senior project (which was to make a game from start to finish with one level) was just the simple shooter tutorial but I used my own programmer graphics and did the sound effects with my mouth (explosions and shooting) and used a simple music making program to do a few bars of different instruments loop over.
Now I just sit around doing simple apps because I don't know what to do that won't be too much to discourage me. For example, I did this yesterday just to be testing something (namespaces and templates):
Now I just sit around doing simple apps because I don't know what to do that won't be too much to discourage me.
I don't really understand this. If you want to get better you're going to have to jump into a harder project, so why don't you? You seem to be acting like your degree is holding you back, and that's silly.
unless you consider the pull a project out of air and hope it is just advanced enough to push you but not too advanced to discourage you)
Again, it's silly to get discouraged. I don't think it's that hard to come up with a project that will push you, and even if you end up giving up on something, I've never met someone who would let that discourage them and make them quit programming then and there. It's ridiculous to expect your first program to be a masterpiece.
I'll certainly agree with you on the matter of CS degrees holding peoples hands. It's ridiculous that some people can study computer science for 4 years and never write a legitimate program. The only people who seem to come out of schools with a degree in CS and be competent are the ones who were programming long before they started getting their degree or the ones who push themselves in college past what their classes require, because these days they don't require enough.
You seem to be acting like your degree is holding you back, and that's silly.
No, my degree isn't holding me back at all. My degree is the equivalent of toilet paper as far as I'm concerned. The thing holding me back is me. I don't know what projects to do that would be harder. I wanted to get into video game programming. I tried doing pong clones numerous times and end up running into the same collision detection issue every time. I'm fine with criticism, but the remarks I normally got was "You don't understand the code or you would be able to figure it out by now." I was a part of Allegro's IRC for a while and when I commented about getting hosting space or something to put my projects on (games mostly) I was told "Why bother? You will be the only one playing them. No one programs with the hope of someone other than them playing them or using their program."
Was told once that I couldn't program because I didn't know how to read the code or understand it. Never did quite figure out what they meant by that as I thought I did understand the code.
By giving up you're just accepting that they're right about you.
You learn most from projects that are out of your league. If you start a project and complete it, then congratulations, you've made something nobody will ever use or see. If you start a project and fail, you'll have learned something for your next attempts.
If you run into the same issue every time, it might actually be that you don't understand what you're doing. Think of why the issue is there, find a way around it, and then start programming.
As for collision detection, SAT with Rectangles and Circles should be enough for Pong. And almost any other 2D game too, really (except that in many more complex games you'd have to figure out how to quickly eliminate impossible intersections, because doing n! intersection checks every frame gets out of hand rather quickly).
Yeah, don't know very many good practices for game programming. I apparently keep forgetting to check in my collision for another variable every time I made it. I was using Allegro every time (code: http://pastebin.com/8cndCgp8 ). The thing that made me mad was one guy told me, "If you lay it out on paper you will see what you are forgetting." I had laid it out on paper about ten times and even did it on my whiteboard and still was missing it.
The ball, if you caught it near the upper corner it would go through the paddle once in a while and just go off screen and make everything lock (paddles would quit moving and ball wouldn't re-spawn).
I don't know if that's whats causing your error, but I noticed you aren't actually projecting the ball out of the paddle if it's colliding with it. If the paddle hits the ball from above or below, that might cause it get locked inside the paddle and eventually be ejected in a random direction.
My school must be an anomaly, I go to community college and our CS department is very small (only 3 professors that teach CS1 or higher), one was an engineer at Fermi labs, another owned a fairly successful software company in the 80's, and the third is new and I haven't taken a class with him yet. I was very happy with the CS classes Ive taken with only one exception a c# class I took last semester where the instructor (a network engineer for the school) didnt acctually know any c# (or programming fo that matter). Ill also note that I was introduced to polymorphism with the shape example as well. While it isn't a particularly good real world (of programing) example, I do feel it likely helped me greatly to grasp the concept.
People who say things like "you are too much of an idiot so I won't bother helping you more" are, often I suspect, ignorant of what is wrong themselves.
I am not familiar with how Allegro works but I am not sure what you are doing with the ball images. Making it blink? (From what I see, knowing nothing about Allegro, you are creating images 1..3 with the image outside the bounds of the bitmap.)
Once you detect that the ball is "past" the paddle, you need to immediately update it so that the ball is no longer past it, but back in the no-collision playing area. The reason for the problem is that multiple events can occur before the ball is actually moved, so the direction of the ball can be changed multiple times before the event queue is drained and the ball is actually moved. You have no control over the number of events queued.
Hope this helps.
[edit]I began this response a while ago, but it seems hanst99 has also analyzed it for you. :-J
No the ball images are designed to make it appear like it is spinning as it moves. Sadly, I told Ubuntu to update to 12.04 and now the desktops are loading weird so I'm stuck under Vista.
@BHXSpecter
Aside from the blinking ball which was easy enough to change, I dont think its bad at all. One thing I do recommend is randomizing the direction of the ball on re-spawn.
This seems to work OK, but I dont know allegro (or game programing for that matter).
There is always going to be an a-holes that enjoy making others feel like shit, pay them no mind they are usually sadder and more depressed then they could ever make you.
If you haven't already, try SFML, Ive started playing with it recently to start getting accustomed to it as I plan on attempting a game this summer when I should have more time.
I'd suggest you to stick to Allegro for a while when you're already used to it, there's little practical reason to switch (except when you insist on using OpenGL 3.3, which I do).
Allegro was the only main library that was recommended at the time I started programming. I never even heard of SDL or SFML back then. OpenGL is way out of my league, though, and at least I know it.