WPF C# Tutorial – Create a Flappy Bird Game in Visual Studio

Adding Events for the flappy bird game

In this section we will start adding events for this flappy bird game. We have two events linked inside the title tag. Key Down event and the key up event. We need to add our logic to make this game interactive.

Right click on the Canvas_KeyisDown keyword and click on Go to Definition

mooict flappy bird c# wpf tutorial - adding key down event

This action will take you to the code view in Visual Studio.

mooict flappy bird c# wpf tutorial - keydown event is now added

As you can see the Canvas_KeyisDown event is added to the code now. We need to do the same to the key is up event.

mooict flappy bird c# wpf tutorial - adding key up event

Right click on the key is up event and click on go to definition

mooict flappy bird c# wpf tutorial - key up event in now added

Once again visual studio has added the key is up event automatically after the click.

Now we can add our variables, functions and import name spaces to make this game work.

Continue on in Page 4




2 responses to “WPF C# Tutorial – Create a Flappy Bird Game in Visual Studio”

  1. Дарья Марахова says:

    Thank you very much from Russia! You are amazing web-teacher!) I loved it!

  2. jwnolan says:

    I had some trouble because I named my project something else, but once I fixed that it worked great! Great tutorial!