× Main Menu

C# Tutorial – Create a T Rex Endless Runner Game in Visual Studio

In this tutorial we will show you how to create a run T Rex endless runner game in Visual Studio using C# programming language. This is a simple game, which you might of played in the Google Chrome offline page. This game is created for educational purposes and hopefully you will have fun and learn something new along the way. We will be using Visual Studio 2017 version to create this game you can use any version it will still work the same, make sure you have downloaded the game assets and using C# programming language.

New WPF C# Tutorial on Parallax Scrolling Endless Runner game tutorial is here, check it out

Lesson Objectives –

  1. Creating a fully working T Rex endless running game in visual studio using C#
  2. Creating jump simulation using force and gravity
  3. Using various data types such as integers, Booleans and strings
  4. Animating multiple objects using timer and picture boxes
  5. Triggering key down and key up events
  6. Creating and invoking a game reset function
  7. Allowing the game to keep score throughout the game
  8. Calculate collision between objects and player picture boxes

Download the T Rex Endless runner images here


8 responses to “C# Tutorial – Create a T Rex Endless Runner Game in Visual Studio”

  1. Cory says:

    i have an issue with the “linking part” what exactly does it mean when you say gameEvent is linked to gameTimer??

  2. Woody says:

    So I got everything working righ texcept for one thing, the t-rex moves up and down through the floor without me pressing any buttons at all

  3. Majd says:

    I have zero erros but there is one problem , when I run the game the t-rex moves up and down through the floor without pressing any buttons what is the problem ???

  4. Mariana says:

    There are no errors in the code, but it does not work right. When running the dinosaur falls and crosses the floor that is appearing at the top of the screen. Upon reaching the base of the screen the dinosaur is regenerated in the initial position, and remains in this cycle.

  5. Fruit says:

    In gameEvent method, where if(trex.Top >= 380 && !jumping) is, change the value to 300 instead of 380 and t-rex won’t jump around without pressing any buttons

  6. pogi lang says:

    how do i tag a obstacle?

  7. Anhar Ali says:

    In the properties window. If you don’t see the properties window right click on the picture box and clock properties.

  8. Rem says:

    When I start my game, the dinosaur sinks under the ground

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

%d bloggers like this: