Archive for March, 2011

XNA Fuchs InputHandler

22/03/2011 2 comments


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

18/03/2011 Leave a comment

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.


A 7MB file converted into an image

The idea is that each pixel in the bit map contains 3 components ( Red, Green, Blue), each one of them Read more…

Categories: My Thoughts, Programming

Fuchs Jr, My beloved cat :)

10/03/2011 Leave a comment

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 Jr (2)

Helping me programming haha!

Read more…

Categories: General & News

Fuchs Navi Wheel – A Creative way of steering a car in a game

01/03/2011 Leave a comment


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.


Steering left using the touchpad

Moving the finger in such a way should continuously steer left

Read more…