WPF C# Tutorial – Create Parallax Scrolling Endless Runner Game in Visual Studio
- Subject: WPF C# Tutorials
- Learning Time: 3 hours
Adding the images
First right clickson the NAME for this project i.e Endless Runner Game in the solutions explorer, hover over add and click on NEW FOLDER option
Rename this new folder to images, now right click on the images folder, hover over ADD and click on Existing Item.
Browser to the folder where you extracted the ZIP file with all of the images inside of it, change the file type to Image Files in the browser dialog box. Highlight all of the pictures and click on ADD. Once you have done that all of the images should appear inside the solutions explorer.
Note – if you are concerned about when we are going to add the images to these shapes, do not worry just yet. All of those will be done through the C# script. We will dynamically add the images to these rectangles when the game is compiling. Follow along the tutorial for now and you will see how it’s done.
We need to add the events for the key down and key up functions we added to the XAML code earlier. Visual studio automatically adds these functions in the C# we just have to click. Let see how its done.
Right click on the Canvas_KeyDown keyword in the XAML window and click on Go to Definition this will add the event inside of the C# script. Do the same for the Canvas_KeyUp keyword. When you have done your C# script should look like the screen below.
Both of the events are now added to the game.
Go to Page 3 to start adding variables
- c# sprite animation
- endless runner game wpf
- game design
- infinite runner
- parallax scrolling in c#
- side scrolling game
- visual studio game development
- wpf c# programming
- wpf game development
- wpf sprite animation