DUCK SHOOT GAME
Under C Programming
Discuss, leave a comment.
Follow any responses to this entry through the RSS 2.0 feed.
Posted on Friday, November 10th, 2006 at 9:40 pm
Under C Programming
Discuss, leave a comment.
Follow any responses to this entry through the RSS 2.0 feed.
Posted on Friday, November 10th, 2006 at 9:40 pm
Ok guys, I’ve got alot of the duck shoot game, here’s just a couple of ideas.
To save me reading the switches repeatedly, I decided to put the current value of each into an array.
I did this by creating a function. Like below:
When the function is called, you supply it with the number of the switch you want to test,
it then returns the value 1 or 0 of that switch.
The binary power is of the sequece 1,2,4,8,16,32,64,128 (It selects an individual switch).
Just & the bitfield with this number, and results in a 1 if switch is on, or 0 if off.
© 2009 James Walmsley. All rights reversed. Contact us.
Comments!