C# Tutorial – Create a Gravity Run Game in Windows Form and Visual Studio

Hi, welcome to this gravity run game tutorial. In this tutorial we will be making a fun game using windows, .net, C# and visual studio. We will not be using any third-party framework for this game. Rules of this game is to use the space key to jump between the top and bottom platforms. There are two obstacles that placed on both platforms, and they will be moving towards the player. If the player collides with any of those obstacles the game will end. A score system will keep track of the obstacles the player manages to evade. Also, a high score system is in the game where players will be able to save their high score for the play through and see if they can beat it on the next play.

Lesson Objectives –

  • Create a fun gravity run game using windows form and visual studio
  • Use labels, picture boxes and timer for this game
  • Use transparent GIF in windows form
  • Change GIF according to where the player lands
  • Create collision detection in windows form between the player and obstacles
  • Keep score and high score in the game
  • Restart the game with the enter key
  • Use various data types such as string, Boolean, integers and random

Download the Gravity Run Game Images Here


Full Source Code for the Gravity Run Game –

It is best practice when you are learning programming to write the codes yourself, use the source code below as guides, try to write them yourself, this way it will be easier for you understand the syntax’s better and slowly become more confident in your own programming.


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