× Main Menu

C# Tutorial – Create a simple platform game in visual studio

In this tutorial we will create a simple platform game in visual studio using C# (sharp) programming language. This game will have points to collect, blocks to jump on to and a door to end the level. This is a basic level programming for a platform game and you should be trying to create another level once this is completed.

Lesson Objective –

  1. Create a platform game using picture boxes
  2. Allow the player to land on top of the picture boxes
  3. Run loops to search where the play has landed and take appropriate action
  4. Use foreach loop to search individual components in visual studio controls
  5. Assign TAG’s to platforms and interact with them
  6. Assign TAG’s to coins and interact with them
  7. Include a game completion format



Full Video Tutorial –



note- There will be some flickering when the character moves and jumps onto the platform, this is caused because of Visual Studio debugging not because of the code, the game will still be working as usual. 


Download platform game images for this project.


15 responses to “C# Tutorial – Create a simple platform game in visual studio”

  1. maas says:

    it is not simple!!!!!!!!!!

  2. Anhar Ali says:

    It’s a simple game tutorial, all it takes it is patience and practice. I’ve failed making this lots of times and it only had to work once for me to start understanding what made it work. Don’t give up

  3. Solihull student says:

    Could’ve elaborated more on where the coding goes, but thanks for the help anyway.

  4. Neil says:

    Trying to learn, but one thing is annoying me. When you jump the “player” goes into to the platform. How do you stop that?

  5. Ann says:

    How can I do it in WPF?

  6. Anhar Ali says:

    WPF tutorial on platform game will be on here soon.

  7. Ann says:

    I’m making it but I’m stucking at key move of Player

  8. Pete_r61 says:

    Could you post the code somehow. Because a copy of the current code does not jump.

  9. Anhar Ali says:

    Are you sure where are you stuck on the code?

  10. Motasem says:

    Very helpful really…Thank you very much

  11. Vance says:

    i have visual studio for mac 🙁

  12. Able says:

    Thanks, that was really nice and easy tutorial to get back on the basics of C# and platform games

  13. KW says:

    I was having trouble jumping and thought I’d typed everything perfectly till I realized:

    I had written force = -1

    instead of

    force -= 1

    Moral of the story: it might seem tedious, but checking over all your work is the best debug process lol.

    Also, retyping the project from scratch taught me a lot more the second go-around. I think I’ll start doing this from now on so I can feel more familiar with methods like these.

    Thanks for the tut!

  14. Dilan says:

    Bro, great code you got there. I just started using c# winforms and this is just great, I got to understand many properties, and for the “lag” in the character I could not find any solution but I can suggest that you can modify the code for the collision in each platform so instead of using the bounds property you should literally find the exact position of your character using .left and .right properties I just finished doing that and now my character will not be able to teleport to the upper part of any platform when touching the platform boundaries and instead it will just fall. Anyways, thanks Moo ICT.

  15. karim Taibi says:

    A real treasure. Thanks for sharing this and spreading Knowledge.

Comment on this tutorial and let us know how you got on -

%d bloggers like this: