0

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;
    }

enter image description here

2
  • FWIW you might be better served asking this question (or searching) in another stack community. Since the course doesn't use C# or visual studio, this is probably not the best forum to get an answer. IMO of course. Apr 18, 2020 at 12:17
  • oh yeah. I will try asking in another community. Thanks Apr 18, 2020 at 16:31

0

You must log in to answer this question.

Browse other questions tagged .