sirlink99 56 Practically a Master Poster

I have a little problem with my if statement. I have a code where I am comparing if a sprite has moved far enough for another one to generate behind it. Here it is (the dots are choped out code):

if (unit > 0)
            {
                if (moved > speed + 5)
                {    .....
                }
                ......
            }

here is where I define moved:

moved = moved + speed ;
enMoved = enMoved + enSpeed;

and then here is a code for the enemy movement (same as above just starts on the other side of the screen):

if (enUnit > 0)
            {
                if (enMoved > enSpeed + 5)
                { .......
                }
                .......
            }

The enemy code works, but the player code does not. The codes are copies except the cariables have been changed. I can upload the full code if you request it. Thanks:)

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.