This board is mostly used for 2d art. If you've got questions about programming, and more specifically, programming in C or C++, check out this board:
http://forum.thegamecreators.com/?m=forum_read&i=20
Good luck, and welcome to the forums.
Rectangle balloonrectangle = new Rectangle((int)BalloonPos[13].X, (int)BalloonPos[13].Y, Balloon[13].Width/2, Balloon[13].Height/2);
Rectangle balloon1rectangle = new Rectangle((int)BalloonPos[10].X, (int)BalloonPos[10].Y, Balloon[10].Width / 2, Balloon[10].Height / 2);
//checking balloon K
if(balloonrectangle.Intersects(bulletrectangle))
{
bullethit = true;
}
if (bullethit == true)
{
BalloonPos[13].Y = - 500;
bullet.Y = -500;
}
////checking balloon N
if (balloon1rectangle.Intersects(bulletrectangle))
{
bullethit = true;
}
if (bullethit == true)
{
BalloonPos[10].Y = -500;
bullet.Y = -500;
}
Could probably be written as
Rectangle balloonrectangle = new Rectangle((int)BalloonPos[13].X, (int)BalloonPos[13].Y, Balloon[13].Width/2, Balloon[13].Height/2);
Rectangle balloon1rectangle = new Rectangle((int)BalloonPos[10].X, (int)BalloonPos[10].Y, Balloon[10].Width / 2, Balloon[10].Height / 2);
//checking balloon K
if(balloonrectangle.Intersects(bulletrectangle))
{
BalloonPos[13].Y = - 500;
bullet.Y = -500;
}
////checking balloon N
if (balloon1rectangle.Intersects(bulletrectangle))
{
BalloonPos[10].Y = -500;
bullet.Y = -500;
}
. You don't really need the bullethit variable. I'm not sure if other parts of your code are looking for it, but it seems like it isn't necessary.
What is the data that is stored inside of these?:
BalloonPos[13].X
BalloonPos[13].Y
Balloon[13].Width
Balloon[13].Height
BalloonPos[10].X
BalloonPos[10].Y
Balloon[10].Width
Balloon[10].Height
Is it possible that the information is the same for different positions in the array?
For example:
for (int i = 0; i < 14; i++) {
BalloonPos[i].X = 5;
BalloonPos[i].Y = 5;
Balloon[i].Width = 100;
Balloon[i].Height = 100;
}
That would make them all disappear.