http://usa.internations.net/zoocrew/downloads.html
This page contains a list of all the programs I have made using C/C++/SDL. Enjoy!!
http://usa.internations.net/zoocrew/downloads.html
This page contains a list of all the programs I have made using C/C++/SDL. Enjoy!!
Compiler: MingW(IDE: Bloodshed Dev-C++ 4.01)
Web Site: Zoo Crew
Forums: Zoo Boards
E-mail: [email protected]
"Do you wanna go to jail or do you wanna go home?!?!" - Alonzo(Training Day)
your collision detection program needs some work on the right side
"There are three kinds of people in the world...
Those that can count and those that can't."
I know, I coded it right. I don't know why it keeps being invisible. For you SDL programmers, can you see whats wrong with my SDL_Collision program?
Compiler: MingW(IDE: Bloodshed Dev-C++ 4.01)
Web Site: Zoo Crew
Forums: Zoo Boards
E-mail: [email protected]
"Do you wanna go to jail or do you wanna go home?!?!" - Alonzo(Training Day)
First off, you need a better coding style.
Here are a couple of hints to get you started:
1. Make your variable names (and class names) meaningful; not uno, dos, r1, r2, ZooClass, etc.
2. Make your function names meaningful (why you picked SimpleGift is beyond me ??? ).
3. Comment you code!
Basically, use a style that makes your code 'readable'. Another programmer shouldn't have to try and figure out what you're trying to do.
You also had some errors in the code I downloaded, like a line in your Collision() function:
dos.x+20; // doesn't do anything, guessing you need an '='
I haven't looked into your collision detection but my first guess would be you forgot to add the width in your calculation when testing the right side of the blue square (easily fixed).
Get your hands on a copy of "Code Complete" by Steve McConnell. Go to a bookstore or library or something, but read the book.
http://www.amazon.com/exec/obidos/IS...499552-9361759
/* edit: and catch the SDL_QUIT event type so you can close the application by killing the window. */
Last edited by tgm; 07-02-2002 at 09:56 PM.
I fixed it now, I complete changed the source code around. I used a more simplier function, but yet the program's size is smaller but does the job.
Compiler: MingW(IDE: Bloodshed Dev-C++ 4.01)
Web Site: Zoo Crew
Forums: Zoo Boards
E-mail: [email protected]
"Do you wanna go to jail or do you wanna go home?!?!" - Alonzo(Training Day)