Hi
Can someone please explain what does bit.shiftlet, bit.and, bit.or,..
How can we use it and in what cases do we use them.
The reason i ask is i try to learn Spritekit and @JanPRO have provided 2 examples. (Flappy bird and brick)
Now in flappy bird i see that he is declaring the collisions categories as int so you can set what body will collide with what category but he is doing it like this:
Why using bit.shiftleft and not give it a number like 1,2,3,....?
I dust dont understand the use of bit.x can someone please explain.
Thank you
Can someone please explain what does bit.shiftlet, bit.and, bit.or,..
How can we use it and in what cases do we use them.
The reason i ask is i try to learn Spritekit and @JanPRO have provided 2 examples. (Flappy bird and brick)
Now in flappy bird i see that he is declaring the collisions categories as int so you can set what body will collide with what category but he is doing it like this:
B4X:
Private category_bird as int
Private category_world as int
....
B4X:
Category_bird = bit.shiftleft(1,0)
Category_world = bit.shiftleft(1,1)
...
Why using bit.shiftleft and not give it a number like 1,2,3,....?
I dust dont understand the use of bit.x can someone please explain.
Thank you
Last edited: