Made progress on my game and now I need to make the second boss bounce up and down. I figured out how to make the boss go down, but once it touches the lower wall, it stops and won't bounce (move up).

        void BossMove()
        {
            if((BOSS.Top + 10) <(this.Height - BOSS.Height))
            {
                BOSS.Top += 10;
            }
            if((BOSS.Height) > 0)
            {
                BOSS.Top -= 10;
            }
        }

Is there a case where both lines 3 and 7 are true?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.