PDA

View Full Version : My First Game!!!



mike_k
06-11-2002, 12:11 PM
This game took me like over a month to make, and every time I think I'm almost done, I find more bugs. But now I think I really am done. So try it out, and tell me what you think!

I must warn you though, it does use BGI graphics, so it is quite ugly and slow.

Vicious
06-11-2002, 12:15 PM
wow... really nice for a first game.

I want to make a break out type game but I couldnt figure out how to make th ball move right.. how did you do it?

mike_k
06-11-2002, 12:23 PM
Basically, I just added the difference between the current X and Y values and the old x and y values to the current values, ie



int x=1, y=1;
int xold=0, yold=0;

do{
x+=x-xold
y+=y-yold
}while(1);


Then to make it bounce back you just change the old value for example, to make it bounce left, you'd say


xold=x+1

My friend told me to give the ball a velocity variable, but i thought that was too complicated, so I did this instead.