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.

2D All the way! / How can i create collision with colors?

Author
Message
Ooska
20
Years of Service
User Offline
Joined: 29th Aug 2004
Location:
Posted: 1st Jan 2005 03:46 Edited at: 1st Jan 2005 03:50
How would i make a sprite collide if it hits a certain color?

(edit) sorry i figured it out!

Weird = Unique. Unique = Human.
Tapewormz
22
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Winnipeg, Mantoba, Canada
Posted: 2nd Jan 2005 11:21
Some old games used to do this. They'd store a mask of impassable screenzones in memory. You could do this with memblocks and a bitmap. Then get the pixel color using your x/y coords and vector to see if it's impassable.

GoPostal
20
Years of Service
User Offline
Joined: 9th Sep 2004
Location:
Posted: 2nd Jan 2005 19:17
Are you using the same way as Tapewormz, or is there a different way? ie. Could you tell us?
ZtEaLmAx
20
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Sweden
Posted: 20th Jan 2005 02:47
hmm
Quote: "(edit) sorry i figured it out!
"
OOSKA Mind posting how you did it?


Quote of the week: These humans i like, they are greedy! - Quark (DS9) - [href]www.darkbasicpro.tk[/href]
GSX R
20
Years of Service
User Offline
Joined: 19th Jan 2005
Location:
Posted: 20th Jan 2005 02:51
Yeah, I would love to know too...

Thanks!
Tapewormz
22
Years of Service
User Offline
Joined: 15th Sep 2002
Location: Winnipeg, Mantoba, Canada
Posted: 24th Jan 2005 08:15
you can mask the impassible area's using say white and the passable area's black.

You'd then use something like

IF POINT(x,y)<>RGB(255,255,255)
PRINT "Free!"
ELSE
PRINT "Blocked!"
ENDIF

That's one way of doing it.

Login to post a reply

Server time is: 2025-05-17 03:17:53
Your offset time is: 2025-05-17 03:17:53