Everything was working pretty much how I wanted when only one player's character was drawn to the screen. Now, I run into all sorts of other errors. The best way for you guys to help me would probably be to compile and run my program for yourselves. I'll attach a zip of the files you need.
1) Use a more descriptive title
2) Give us some background. Help us help you. DOn't ask for us to just "fix it".
Debugging has to be systematic to work. Trace through your program at the first sign of a problem (or better yet. right before something happens). step through execution line by line while watching variables.
Test individual functions for correctness if you can.
How come you still haven't fixed your animation problem? I explained in quite some detail, complete with examples, how to do that in my last post to your thread (the response to your second post on that thread).
[edited to provide further help]
In response to your known issues in the comments at the start of the program:
// two players are stuck together
// player 2, as far as I can tell, is not starting at the location I specified (x-coordinate 440)
Yep, that's because you're plonking them both at the came location, (p1, staticy). You're also using frame1 animation to display player 2 (albeit flipped).
// game crashes for reasons unknown
Run it in debug mode and see where it stops?
// occasionally game will skip the last frame of any animation, even when only one player is there and works properly...is that always going to happen or can that be fixed?
See my comment at the top of this post for that one.
Two of these 3 issues are quite basic errors (particularly the positioning one), and it indicates you have made very little effort, if any, to work out for your self why it's not working. That just plain lazy. I'm not going to help again if you're not going to give debugging a good shot before asking for help.
I don't know how to read a debug screen.
What IDE are you using? (Dev-C++, Code::Blocks, Visual Studio, etc.)?
I'm using Visual Studio 2005.
I don't know how to read a debug screen.
I'm using Visual Studio 2005.
Okay, you should have a debugger built into Visual Studio 2005. You can go to your help menu and do a search for "debugger" or even "debug", which will give you a start on how it works.
Note that you can set "breakpoints" and when running in debug mode, the program will pause at this breakpoint. Then you can manually step line-by-line through your code and see exactly where your code bombs.
Knowing how to use a debugger is not optional, it is a part of programming. No better time to learn.
Alright, got it working. Most of my errors were just due to copy+pasting and forgetting to change the things I was supposed to. Thanks for the tip on the debugging. I asked my brother for help in debugging, who just finished his sophomore year in college (computer science major) and oddly enough, he doesn't know how to read a debug screen either. Usually the help files in VS just remind you of syntax without actually explaining anything, but I'll give it a go.
who just finished his sophomore year in college (computer science major) and oddly enough, he doesn't know how to read a debug screen either.
Not strange at all. As far as i know they never "teach" anyone how to use a debugger and the students just end up using "printf" debugging.
Meh. I was taught how to use GDB at one of my uni courses.
Debugging is not only a matter of using a GNU/GDB interface or the M$ or the borland's one. Its also a matter of code.
There are plenty of coding techniques in doing debugging. glibc, or the MFC or the C standard support functions and macros in order to make debugging. In our particular case, allegro also provides some basic routines for debugging your program. check the "debugging" session in the manual.
And by the way I never was taught GDB in the university but thats shame because a lot of things about the processor and the system could be learned by the time.
however : fprintf(stdout,"this s the greatest debugger ever %d\n",var);