• Content count

  • Joined

  • Last visited

Community Reputation

139 Neutral

About XsoodX

  • Rank
  1. I am making a 2D physics based game using Box2D for Physics and SDL for Graphics.   I need to plot a collision line along the path of a ball(in linear trajectory) as it moves. The line should not collide with the plotting ball but other balls(which are also plotting lines). Also if the plotting ball collides with an object, it should stop plotting that line and begin plotting another, and should be collidable with the original. The images describe what i need. The ball has a radius which will intersect with the line if it is plotted from the center of the ball.      How can I implement this?
  2. I am making a simple physics based game using box2D as physics engine and SDL for graphics.   I need to put multiple lines on the screen using SDL_gfx. Is there any way i could blit those lines on a SDL_Surface and then that on my Main Screen, so as to avoid calling the line creation function too many times?  
  3. I am trying to make a simple physics based game in SDL, and i require a ball to bounce of lines in game.   However, when the ball collides with the line, it clips through it, messing up the collision count. The problem is due to the speed of the ball. If the ball travels fast enough, it can pass right through the line. I use frame independent motion and a circular collision detection for the ball   How can i make sure the collision doesn't clip?   Code For the Ball Collision Detection bool Projectile::check_collision(Line L) { int X1,X2,Y1,Y2,CL; int Cx=0,Cy=0,CP=0,Px=0,Py=0; float shortest_distance; double slopeL=0,slopeP=0; L.get_Line(X1,Y1,X2,Y2); getLocation(Px,Py); Px+=size/2; Py+=size/2; if(X2-X1!=0) { slopeL=(Y2-Y1)/(X2-X1); slopeP=-1/slopeL; //Y=mX+C; CL=Y1-slopeL*X1; CP=Py-slopeP*Px; Cx=(CL-CP)/(slopeP-slopeL); Cy=slopeP*Cx + CP; } else { Cy=Py; if(X2>Px) Cx=X2-Px; else Cx=Px-X2; } shortest_distance=sqrt(pow(double(Cx-Px),2)+pow(double(Cy-Py),2)); if(shortest_distance<size/2) { if(X2-X1!=0) on_collision(slopeL); else on_collision(); return true; } else return false; } If any more info is needed please tell me.
  4. SDL Release Build Problems

    OK i got it working, just had to copy the image files,dlls and exe into a release folder inside another folder in my solution folder. THANKS!
  5. SDL Release Build Problems

    [quote name='Servant of the Lord' timestamp='1351364077' post='4994481'] For each of your assets (sounds, images, fonts, etc...) you are loading, do you do proper error checking and report the error messages in text files somewhere? What do the errors say? Have you put the SDL libraries in the same folder as your executable? [/quote] No, Just included the dll files, what all exactly do i have to put in the executable folder and how do i do the error checking?
  6. SDL Release Build Problems

    I have made a simple PONG game for my school project in VC++ 2010 using SDL. When i build the Release build inside VC++ it works perfectly fine, but when i try running the .exe from the solution folder, Nothing happens at all. My SDL project does include .png files. Can someone pls tell me how to build a proper release so that i can take it in a pendrive and install it on other comps?
  7. I know the basics of C++ (Mainly Console applications) and have made many simple text based games, but i want to go further and start 2d (and later 3d) graphics, But i don't know where to start. Can someone help me find a good book, or a tutorial site, or anything at all to get me started?