Answer the question
In order to leave comments, you need to log in
How to use bit operations in games?
Not strong in bitwise operations. In some games on github, I see that they use bit shifts there (mostly). Here is an example -> https://github.com/Jahmaican/jcaster/tree/master/class.
Answer the question
In order to leave comments, you need to log in
Shift right (>>) is a division by 2^n rounded down.
Shift left (<<) is a multiplication by 2^n
For example, x >> 1 is the same as x / 2 with rounding
x << 2 is the same as x * 4
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question