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 / hit sides?

Author
Message
TravisP
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location: Behind you, with a knife!
Posted: 15th Aug 2004 14:17
I am working on a Breakout type game and i cant find a way to check what side it hits. I was thinking of makeing each side a type diff. shade of black (ex. RGB 1,0,0) but how can I detect which shade of black the ball hits?

Thanks,
Travis

Good thing everyone here is a figment of my imagination.
TravisP
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location: Behind you, with a knife!
Posted: 15th Aug 2004 15:12
anyone?

Good thing everyone here is a figment of my imagination.
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 15th Aug 2004 20:49
if you look in the help, db probly has some stuff on that , but you could get the wall by the co ordinates of the ball e.g.
TravisP
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location: Behind you, with a knife!
Posted: 16th Aug 2004 00:49
I was trying to avoid that so i could easily do more levels. i found a cammand called point but i cant get it to work right.i get all these number but i was when it should be 0,0,0

Thanks,
Travis
(PS: I have DBPro.)

Good thing everyone here is a figment of my imagination.
TravisP
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location: Behind you, with a knife!
Posted: 16th Aug 2004 03:21
Is this impossible or just no1 wants to help?

Good thing everyone here is a figment of my imagination.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Aug 2004 05:14
Here's the code from my breakout game. "_bounce_it" is the routine that determines which side was hit.




"eureka" - Archimedes
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 16th Aug 2004 05:29
your point problem is probably cos it returns the color value as a dword (which should just be 0 for black though) however, just run a different program which prints the values of the two colors u are using and then use these values in your pong game
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 16th Aug 2004 15:46
The point command is also subject to the display mode color resolution that is set, such that you may paint the screen with rgb(85, 45, 0) [5582080] and get back rgb(82, 44, 0) [5385216] when you use the point operation. This first caught me some time ago when doing on-screen detection so you have to take in account which color depth you are using and which values are actually being placed into video memory. Some testing is required, or just use the math process...

Any truly great code should be indisguishable from magic.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Aug 2004 15:49
Plus, if your ball is moving to fast, it may completely miss the side check that way.

"eureka" - Archimedes

Login to post a reply

Server time is: 2024-11-27 06:36:50
Your offset time is: 2024-11-27 06:36:50