Skip to main content
gamedev.net
🔒 Locked

question

Started by EIGamerzX 6 replies 1k views
Original Post
EIGamerzX
EIGamerzX
does anybody know how I could read the pixel values (RGB) of a given rectangle? and check to see if a given colour was in that rectangle? I need to know how for a little collision detection program i''m fiddlin around with. thanks to anyone that can help.
Free Game Textures!!!http://www.vb3d.com/Textures.html
EIGamerzX
EIGamerzX
The documentation is more confusing than it actually is and I rarely ever understand it until it''s put into an example so could someone please make a program that loads a scene (a pathway) then go into paint and fill in the different sections of the scene with either one of two different colours, i''m using white and brightgreen, if the area is white the character can walk around, if green the character can''t. Then save the picture as collision.bmp, now make a 50*50 square and load it in as a .bmp that you can move around the scene. now what happens is the program has to check the area of the 50*50 square bmp on collision .bmp (which doesn''t get blitted to anything i think) and see if there''s a green pixel and if there is return the squares position to it''s old value. it sounds a little confusing but if you modify cone''s 2nd tutorial (the moving .bmp one) then it''s not hard to do EXCEPT FOR GETTING THE COLOURS!!!!!!
*goes off to paint everything in house black and white*
Free Game Textures!!!http://www.vb3d.com/Textures.html

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.