i need a working code in C++ (windows platform). It should be able to move a ball on the screen.
a nicely commented code will be aprecitated.
thxs
Printable View
i need a working code in C++ (windows platform). It should be able to move a ball on the screen.
a nicely commented code will be aprecitated.
thxs
Hehe
Btw, is this a troll or something?Quote:
2. Don't ask people to do all your work for you
Usually, people don't like "Do this code for me" posts, but... anyway, I'll give this general idea to you:
Code:while(GameIsOn)
{
Ball.X += Ball.dX;
Ball.Y += Ball.dY;
if(Ball.X < LEFT_SIDE_OF_SCREEN)
{
Ball.X = LEFT_SIDE_OF_SCREEN;
Ball.dX = -Ball.dX;
}
if(Ball.X > RIGHT_SIDE_OF_SCREEN)
{
Ball.X = RIGHT_SIDE_OF_SCREEN;
Ball.dX = -Ball.dX;
}
if(Ball.Y < TOP_SIDE_OF_SCREEN)
{
Ball.Y = TOP_SIDE_OF_SCREEN;
Ball.dY = -Ball.dY;
}
if(Ball.Y > BOTTOM_SIDE_OF_SCREEN)
{
Ball.Y = BOTTOM_SIDE_OF_SCREEN;
Ball.dY = -Ball.dY;
}
}
Please post the code (nicely commented) for a state of the art First Person Shooter. It should have 20 levels, and 30 player models as well as pre compiled resources. It should work in both DX and GL depending on the users settings. Thanks.
Haha, yeah ok, you made your point by now.Quote:
Originally posted by dbgt goten
Please post the code (nicely commented) for a state of the art First Person Shooter. It should have 20 levels, and 30 player models as well as pre compiled resources. It should work in both DX and GL depending on the users settings. Thanks.
Indeed it smells alot like homework. So go look around for
yourself first.
A place to start
Also, it must know what i want so that it can program itsself, for when it comes to doing code myself i become quite confused. Please use my name in given credits, as i will tell all my l337 friends that i haxx0r'd the code myself, being how l337 i am.Quote:
Originally posted by dbgt goten
Please post the code (nicely commented) for a state of the art First Person Shooter. It should have 20 levels, and 30 player models as well as pre compiled resources. It should work in both DX and GL depending on the users settings. Thanks.
HAHAH! You're wonderfull, i'l bet he has a trauma by now:cool:Quote:
Originally posted by RoD
Also, it must know what i want so that it can program itsself, for when it comes to doing code myself i become quite confused. Please use my name in given credits, as i will tell all my l337 friends that i haxx0r'd the code myself, being how l337 i am.
screw it i'll do it:Quote:
Originally posted by dayknight
i need a working code in C++ (windows platform). It should be able to move a ball on the screen.
a nicely commented code will be aprecitated.
thxs
Code:
int CreateBall(I_WANT_YOU_TO_MAKE_A_BALL)
{
NOW_DO_IT = TRUE;
RETURN MY_BALL_JERK;
}
HAHAHA!
// Something was here but i laughed so hard i coulnd't finish it:p
I had to do that for my Java final (it was in a basic class but my teacher decided to give me and a friend an "advanced" final). I had to be able to set up a variable sized grid (2x3, 4x20, etc), and make a ball start in the upper left and bounce at a 45 degree angle until it hits a corner. Then, I had to output how many times it bounced. I was trying not to laugh when he told me what to do cause I still remember all the code from when I programmed my breakout clone :P My friend had a collision check for each of the 4 directions (NE,NW,SE,SW) on each of the 4 walls, so he had 8 collision detections :P I told him it was much simpler to check if the ball was touching a wall and then just reverse the trajectory of the according axis, but he didn't have that either :P Ah...well...maybe you had to be there...
//napKIN
what header files do i need?
It's all in thereQuote: