I am currently doing my final project. My game is supposed to shoot out a fireball whenever the spacebar is pressed and the wall in front of it gets destroyed. It works, when the spacebar is pressed, the wall gets destroyed. But the problem is that the fireball doesn't show up. Only the fireball won't show up. I was thinking because it's too fast. That's why we can't see it. Picture is for visualization
private void fireballs_Tick(object sender, EventArgs e)
{
fireballs.Visible = true;
if (Shazam.Location.Y == 380 && alive == true)
{
this.fireballs.Location = new System.Drawing.Point(62, 380);
}
else if (Shazam.Location.Y == 20 && alive == true)
{
this.fireballs.Location = new System.Drawing.Point(62, 20);
}
else
{
this.fireballs.Location = new System.Drawing.Point(62, 200);
}
int fireballs_hit;
do
{
fireballs_hit = 0;
fireballs.Left += -speed;
if (fireballs.Bounds.IntersectsWith(Wall_1.Bounds) || fireballs.Bounds.IntersectsWith(Wall_2.Bounds) || fireballs.Bounds.IntersectsWith(Wall_3.Bounds))
{
fireballs_hit = 1;
}
} while (fireballs_hit != 1);
fireballs_hit = 0;
if (fireballs.Bounds.IntersectsWith(Wall_1.Bounds))
{
Wall_1.Visible = false;
}
else if (fireballs.Bounds.IntersectsWith(Wall_2.Bounds))
{
Wall_2.Visible = false;
}
else
{
Wall_3.Visible = false;
}
fireball.Stop();
fireballs.Visible = false;
}