Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Whats wrong with my code? - Box leaves the screen then reappears

Author
Message
Stedders
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 14th Oct 2003 14:29
Hey,

I've coded a little program that moves a box across the bottom of the screen.

When the box gets to the edges I would like it to stop, but it disappears off of the screen and then reappears on the screen where it was meant to have stopped and won't move off the screen.

Here's the code to move the box and check where it is on screen,



I believe the code is correct but I can't understand why it disappears the first time, check source for full code.

Is my code correct?

Is there a better way to check?

Cheers
Stedders

Are Games getting worse or our standards getting higher?
skovron
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 14th Oct 2003 15:38
yeah I've checked your code and found one bug

you've just set up your box that L# (left) was greater than R# (right)

you've got


change it to


then it works well

Login to post a reply

Server time is: 2024-11-25 13:52:18
Your offset time is: 2024-11-25 13:52:18