I'm trying to create a breakout clone
and for the moment I'm stuck at the multiball part
first I started with a structure for my ball
struct position
{
float iPosX ;
float iPosY ;
float iVelX ;
float iVelY ;
float iWidth ;
float iHeight ;
bool bState ;
} ;
then I declared it :
position ball ;
so I could use it this way :
ball.iPosX, ball iPosY, ......
so I started on the multiball code, and I thought why not just declare it as an array and check if the ball is still alive or not?
so :
position ball[4] ;
and for the begining only ball[0].bState is true, so I just have 1 ball
when the multiball mode is activated I set all the states to true and process all my balls
now the problems start
my game just exits without an error and since I only added the multiball part I guess it has something to do with me declarng an array for my balls
position ball[4] ;
after I bit of searching I found out that my program only exits when I try to use that array
for example :
// Blit the balls
for (int b; b<4; b++)
{
if (ball.bState == true)
{
// make the current copy position for the source
SetRect(&src, 0, 0, 16, 16) ; // SetRect( &src, left, top, right, bottom );
// make the current paste position for the destination
SetRect(&dest, (int)ball.iPosX, (int)ball.iPosY, (int)(ball.iPosX+ball.iHeight), (int)(ball.iPosY+ball.iHeight)) ;
} // end of if
} // end of for b
// now just blit the source cube to the destination cube
</pre>
can some1 pls help me
thanx in advance
<SPAN CLASS=editedby>[edited by - da_cobra on April 5, 2002 1:28:22 PM]</SPAN> </b>