I've mentioned this before, but I never really understood bit flags until I tried out Cocos 2D and read about how you implement hit detection. You identify different rendered objects with an enum value, and it would spit out a result every frame that you use bitwise logic on with the enum to determine which objects were touching. Such a simple and elegant way to represent combined state.

It may be elementary for some folks but I was not a CS major.

  • 0
    I am a CS major and that was not elementary to me and I had no clue that is how that worked in games :D thanks man!
Add Comment