i & 1 means take i and bitwise And it with 1. Since this is an if statement essentially. If the result of the bitwise And is 1 then it will set offset.x equal to step. otherwise it will set it equal to -step.
The truth table for binary is below.
0 & 0 = 0
0 & 1 = 0
1 & 0 = 0
1 & 1 = 1
Search found 33 matches
- January 24th, 2018, 5:21 am
- Forum: Everything
- Topic: bitwise and operator
- Replies: 19
- Views: 7728
- January 24th, 2018, 5:13 am
- Forum: Everything
- Topic: Assembly
- Replies: 2
- Views: 2003
Re: Assembly
What kind of assembly are you looking to get into? I recommend MIPS since it is simple and you can download a tool called MARS which can emulate it. Here is a link to MARS if you are interested. http://courses.missouristate.edu/KenVollmar/mars/ I found this MIPS tutorial series if you are interested...
- February 28th, 2015, 8:10 pm
- Forum: Everything
- Topic: My first game
- Replies: 11
- Views: 5498
Re: My first game
That was a fun game. I got a score of 15014 with 278 kills. The menu is pretty cool.
- July 31st, 2014, 1:08 am
- Forum: Everything
- Topic: some sort of fluid simulation
- Replies: 3
- Views: 2367
Re: some sort of fluid simulation
This is a pretty cool simulation! Your code is easy to understand. You should add features like changing colors. Changing fluid spread speeds based on the type of fluid. Add Gravity so then the liquids move towards the bottom.
- July 21st, 2014, 9:21 pm
- Forum: Everything
- Topic: Java Port of the Framework
- Replies: 0
- Views: 6135
Java Port of the Framework
Well I made a Java with Lwjgl version of Chili's Framework just for fun. It is an eclipse project but you could convert it if you want to use Netbeans. There is one bug and that is if you set a color for something to draw and then draw a texture then the texture would have that color placed over it....
- August 31st, 2012, 1:37 am
- Forum: Everything
- Topic: I need help
- Replies: 7
- Views: 3014
I need help
In the project attached I made a cube. I am trying to get the cube to spin but I am not sure what code should be used to get the cube to rotate. I used the drawline function to make the cube.
I added my other project were the cube moves but it does not rotate.
I added my other project were the cube moves but it does not rotate.
- August 27th, 2012, 1:48 am
- Forum: Everything
- Topic: Check this out
- Replies: 1
- Views: 2291
Check this out
I made a menu for the pooface ex+alpha game so when you play the game you don't have to go find the hiscore file in a folder to see your highscore.
- August 22nd, 2012, 12:41 am
- Forum: Everything
- Topic: Help
- Replies: 3
- Views: 2038
Re: Help
Thanks. I forgot the sound and scoreboard files
- August 21st, 2012, 10:26 pm
- Forum: Everything
- Topic: Help
- Replies: 3
- Views: 2038
Help
I wanted to play the pooface ex+alpha on a computer that does not have visual studio. I copied the pooface game that i was built in release mode and the pdb file and when I ran it then there is a pop up saying chili directx framework.exe has stopped working. How could I fix this.
- August 13th, 2012, 6:17 pm
- Forum: Everything
- Topic: Help needed urgently guys!
- Replies: 15
- Views: 6140
Re: Help needed urgently guys!
Sleep then work on it when you are tired then you can't think.