How to Make 2D Endless Runner Game in Unity - Beginner Friendly - Dino Game

Share

Summary

A beginner-friendly tutorial on building a Chrome Dino-style 2D endless runner game in Unity, covering player movement, obstacle generation, and score tracking.

Highlights

Setup and Environment
00:00:24

The project begins with setting up the Unity environment, creating necessary folders, and designing the ground using a square sprite and a box collider.

Player Configuration
00:01:27

Creating the player character with Rigidbody 2D and Box Collider 2D components, while freezing rotation and X-axis movement to allow for vertical jumping logic.

Player Jumping Logic
00:03:32

Writing the C# script to handle jumping, incorporating a grounded check to prevent infinite mid-air jumps, and setting jump force and gravity parameters.

Obstacle Generation
00:07:26

Developing the Spike Generator script to instantiate obstacles dynamically, using trigger zones to spawn new spikes and move them toward the player.

Refining Mechanics and Difficulty
00:11:35

Adding logic to increase game speed over time, implementing object destruction when out of view, and adding randomness to spike generation timing.

Score Tracking and Game Over
00:15:00

Implementing a UI score display that increments over time and adding a game-over state triggered upon collision with an obstacle.

Recently Summarized Articles

Loading...