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 / Image off screen (When do I tell it to stop)

Author
Message
Stedders
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 13th Oct 2003 01:11
Hey guys,

I've now got a box and circle on screen, they respond correctly to input, but they keep travelling off screen.

I added some code and now the circle stops when it gets to the top of the screen but still disappears(sp?) at the bottom.



See the source for the full code.

Cheers in advance.

Stedders

Are Games getting worse or our standards getting higher?
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 13th Oct 2003 01:24
Simple really, you have just confused yourself by swapping x and y.

You have

Dy#=640.0
Dx#=480.0

Width dx# should be 640 and height dy# should be 480

Remember when drawing, x is left to right starting at 0 and y is top to bottom starting at 0.

Change all your variables to make sure that x and y are right way round

If your mansion house needs haunting, just call Rentaghost!
Stedders
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 13th Oct 2003 01:31
Cheers, I think that makes sense.

I'm going to go through and change everything.

While we're on the subject does anyone have some tips for detecting collisions between the circle and box?

Stedders

Are Games getting worse or our standards getting higher?
muphesto
20
Years of Service
User Offline
Joined: 30th Oct 2003
Location:
Posted: 8th Nov 2003 01:12
cheers this helped me aswell for the game im making for my uni course

Login to post a reply

Server time is: 2024-09-21 07:49:44
Your offset time is: 2024-09-21 07:49:44