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.

DarkBASIC Professional Discussion / Challenge bouncing box

Author
Message
Jim
23
Years of Service
User Offline
Joined: 10th Feb 2003
Location: United Kingdom
Posted: 18th Mar 2003 23:15
Please can some 1 help me. I made a programme in QBASIC the other day where boxes bounced of each other because of the pixel colour using the point command. Eg if not bakcolour (checking 8 points on a square, corners and middle edges,) then bounce. I tried to replicate this in DB but the point does not return sprite colour. Why???? I do not know. Perhaps its the way DB is programmed but I think a command description should actually do what it says eg

Point command:

"This command will return the pixel color value from the screen at the specified Coordinates. The
parameters should be specified using integer values. You can also read from bitmaps by using the SET CURRENT BITMAP command." - Please fix in next patch.

O from the screen eh? Well where is the invisable text that states only really return crap.

How else am I supposed to check which side of the box has been hit if not with the point command.

Any here is my snippet please add two of you own texture files to make work.



Here is my really good qbasic version

use arrow keys:

http://www.geocities.com/pugh2317/ESCTHEBALLS.zip
The Universe has infinate possibilities. So do YOU!
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 18th Mar 2003 23:22
red=rgbr(point(x,y))
green=rgbg(point(x,y))
blue=rgbb(point(x,y))

Quote: "Well where is the invisable text that states only really return crap."

That 'crap' is the exact information it should return.

Next week in idiots flame DB we'll be taking a look at a QBASIC v's DarkBASIC comparison where QB tries to draw a 3D spinning cube and DB laughs at it.

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 19th Mar 2003 03:45
Looks like I'll have to tape that episode

malcom2073
23
Years of Service
User Offline
Joined: 12th Mar 2003
Location:
Posted: 20th Mar 2003 05:00
Lol me too. I'd love to see DB laugh

Jim
23
Years of Service
User Offline
Joined: 10th Feb 2003
Location: United Kingdom
Posted: 21st Mar 2003 20:43
Well if you actually looked and ran my code you would see that the point command does not return to color of the sprites.

The Universe has infinate possibilities. So do YOU!
Richard Davey
Retired Moderator
24
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 22nd Mar 2003 02:37
You're right - it doesn't return the colour of the sprite because it's not actually on the screen the point command reads from. It's hard to explain, but suffice to say you've three choices:

1) Use "paste sprite" to paste the sprite data onto the screen
2) Use "paste image" instead of sprites if all your collision is done via the point() command then there's no difference
3) Don't use the point() command for collision, use sprite collision commands instead.

The following code is an example of number 1 above:



Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
Jim
23
Years of Service
User Offline
Joined: 10th Feb 2003
Location: United Kingdom
Posted: 23rd Mar 2003 22:10
x-d Thanks Rich

I wanted to use the point command to return which side of the box was hit so that I can bonce them off in the correct direction. I wonder if there is another way to return which side of the box was hit other than the point command? Probally some complicated calculation

Thank again.

The Universe has infinate possibilities. So do YOU!
TRS80Model1
23
Years of Service
User Offline
Joined: 2nd Feb 2003
Location: - Please Select -
Posted: 23rd Mar 2003 22:15
Simple math and arrays and or a pixel counter will work.
Jim
23
Years of Service
User Offline
Joined: 10th Feb 2003
Location: United Kingdom
Posted: 24th Mar 2003 20:36
Any chance of a snippet TRS80Model1

Thanks

The Universe has infinate possibilities. So do YOU!

Login to post a reply

Server time is: 2026-07-11 12:01:51
Your offset time is: 2026-07-11 12:01:51