Archive
XNA Fuchs InputHandler
Introduction:
Each XNA “Game” I program I have to take input, something like the following
KeyboardState prevKeyboardState; protected override void Update(GameTime gameTime) { KeyboardState keyboardState = Keyboard.GetState(); if (keyboardState.IsKeyDown(Keys.Left) && prevKeyboardState.IsKeyUp(Keys.Left)) { // Do stuff } prevKeyboardState = keyboardState; }
I have to create two KeyboardStates, one for this frame & the other is for the previous frame. Then in most cases I check that some button is pressed only in a frame not in its predecessor…( because even if you press a button and remove your finger quickly the, button will be considered pressed in more than one frame )
Same issue goes for the mouse.
So I thought I should create my own input handler, Read more…
File To Image Converter
When I run out of programming ideas I program some weird & sometimes useless stuff just for fun :D.
This program converts a file into a bitmap and then saves it as a Png\Bmp image, the file then can be retrieved (along with its name) from the image.
The idea is that each pixel in the bit map contains 3 components ( Red, Green, Blue), each one of them Read more…
Fuchs Jr, My beloved cat :)
Well, My life isn’t all about programming :D, I have a male cat named Fuchs Junior and want to share some funny videos about this cat 🙂
If you are not a fan of cats I recommend that you stop reading immediately :(.
Fuchs Navi Wheel – A Creative way of steering a car in a game
Introduction:
One day while I was studying for an exam then an idea came to my mind!
Wouldn’t it be cooler to use the touchpad to steer a moving car (instead of the boring Left\Right keys)?
I’m not a big fan of racing games but I liked the idea…
To simulate rotating a real steering wheel the player should create circles on the touchpad, counter-clockwise (ccw) to steer left, clockwise (cw) to steer right.
Moving the finger in such a way should continuously steer left