drmcnellis / collisiondetectionkit

Automatically exported from code.google.com/p/collisiondetectionkit
0 stars 0 forks source link

Exclude Color (almost) not working #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Copy CDK example on excludeColor
2. Compile
3. Test 

What is the expected output? What do you see instead?
Expected: Red color is excluded.
Actual: Red color is not excluded (i.e. collided)

What version of the product are you using? On what operating system?
v1.5

Please provide any additional information below.
Do this has something to do with using 0xFF as base of color on detecting 
collision?

Original issue reported on code.google.com by irvan.pu...@gmail.com on 18 May 2012 at 2:54

GoogleCodeExporter commented 9 years ago
Nevermind about the additional information above. I just realized how silly I 
was to not understand Bitwise Operators: 
http://flash-creations.com/notes/actionscript_operators.php

Still, excludeColor is not working. Windows XP SP3, Flash CS3 Professional (v9) 
:/

Original comment by irvan.pu...@gmail.com on 18 May 2012 at 3:24

GoogleCodeExporter commented 9 years ago
I am trying to fix this, so I am learning 
http://www.bobbyberberyan.com/2010/08/bitwise-operations-in-actionscript-3/

What I had in mind is r/g/b-minus value, since it is uint, when it is minus, it 
return big value (totally fine for color, but return false in comparison, as in 
item1Flags and item2Flags not working)....

Original comment by irvan.pu...@gmail.com on 18 May 2012 at 3:53

GoogleCodeExporter commented 9 years ago
I found out the easy way to fix this: Change variable type of a/r/g/b into int 
(since you do need minus), but if will this bring out another problem, I don't 
know :/

Original comment by irvan.pu...@gmail.com on 18 May 2012 at 4:08