0% found this document useful (0 votes)
52 views41 pages

Game Development Basics with Unity

The document outlines a game development session led by Mukal Markanda at NIT Jalandhar, focusing on using Unity as a game engine. It covers the essentials of game creation, including necessary assets, movement mechanics, collision handling, and scene management. The session also emphasizes the importance of game engines and provides a brief introduction to programming concepts relevant to game development.

Uploaded by

yogeshgarg0612
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views41 pages

Game Development Basics with Unity

The document outlines a game development session led by Mukal Markanda at NIT Jalandhar, focusing on using Unity as a game engine. It covers the essentials of game creation, including necessary assets, movement mechanics, collision handling, and scene management. The session also emphasizes the importance of game engines and provides a brief introduction to programming concepts relevant to game development.

Uploaded by

yogeshgarg0612
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

NIT Jalandhar

WELCOME
TO
GAME
DEVELOPMENT
SESSION By – Mukal Markanda
(GDGC New Gen)
How are Games
Made?
Various Ways:
There are several ways to start
developing your own games. You may
choose any path as it totally depends
on your taste as how you would like to
do things:

1. Using Game Engines(Best)

2. Programming from Scratch(Scary)

3. No Code Platforms(Come On Bruh)


Why use Game
Engines?
CUZ ITS
(why reinvent the wheel when you can just drive the car)
EZ
Popular Game
Engines:
[Link] (the one we will use)

[Link] Engine

[Link]

[Link] Maker

[Link] Studio
NIT Jalandhar

Basic Necessities
for a Game

What type shi we


require?
We require some things to
build our game
[Link] Idea(Theme, design)
2.2D or 3D Assets(Characters, animations)
[Link] Design
[Link], Sound Effects
[Link] Flow
[Link] Engine
NIT Jalandhar

Let’s Get Started


with
Unity and
Make a Game
WINTERFEST 2025
Download Assets for Session
Start() and
Update()
Start(): Function that only runs at the start of the scene.
Hence mainly used for storing values in variables via GetComponent<>()

Update(): Runs once every frame. Hence used for the updation of the code and
bringing game into the motion.
NIT Jalandhar

Movement

WINTERFEST 2025
Input
System:

[Link](_Key_) returns 1 when the INPUT


Key is pressed, and 0 otherwise.
GetKey GetKeyDown GetKeyUp
Hence used to add movement like jump,
run etc with if conditions in Update()
method.
Axes:

“Horizontal” axis returns 1 when you


press ‘D’ or ‘right_arrow’ key and -1 when
you press ‘A’ or ‘left_arrow’ key and 0
otherwise.

Same way there are other axes’s and also


you can make your own too.
Forward/ Backward
Movement:

Now we can use our axis and update the


velocity of our RigidBody2D in x-direction
every frame while the corresponding axes
key is pressed.
Moving the Ground
Downwards:

We will be moving the ground downwards


to give the illusion of lava rising upwards.
Jump:

Similarly we can add velocity to our


RigidBody but in y-direction to make it
jump.
PROBLEM!

Our character keeps jumping like a mad man.


FIX:

Just add ground check pal


Ground Check:

There are two ways to approach this:

1. By detecting collision with ground Tag.


2. By RayCasting (We will use this because its an imp. concept)
Ray Casting:

Raycasting works by casting Rays from


centre of a body to a particular area and
checks if a particular layer is encountered
or not.
If collided it would return 1, otherwise 0.

It requires these 6 arguments for proper functioning: (centre, area, angle, direction,
distance, layermask)
Visualising Boxcast:
Animations
Animator:
Just a component to manage the animations and there flow.

• Animations needed:

1. Idle – When?: Everytime.


2. Running – When?: When “Horizontal” axis is not 0.
3. Jump – When?: When player is not on ground.
…..
Hence to play these animations we will create the animations and then play
them when the given conditions get met.
NIT Jalandhar

Handling
Collisions

What type shi we


require?
OnCollisionEnter2
D():

This function is executed everytime there is


a collision in your scene.
Takes one argument i.e. the colliding body.

Similar function is OnTriggerEnter2D().


Let’s Kill our Player Now
Let’s Kill our Player
Now 😈
Infinite Ground
Generation
Instantiate() and
Destroy():

Destroy(gameObj): Destroys the game


object passed as argument.

Instantiate(gameObj): Spawns the game


object passed as argument.
NIT Jalandhar

Menus in
Unity

WINTERFEST 2025
Menus: To display options for our player.
Menus to create:
1. Pause
2. Death
3. Level Win(if game requires){this one doesn’t}

Buttons Required:
4. Home
5. Resume
6. Restart/ Play Again
Logic of each button:

1. Home : Change the Scene to home.


2. Resume : Set time scale to 1 again.
3. Restart/ Play Again: Reload our game scene.
NIT Jalandhar

Scene
Management

What type shi we


require?
Scenes:

In a game multiple scenes are required for different


parts of the gameplay.
For eg: Main Menu at the start of the game is on one
scene, while the game itself is on another.
Used to switch, reload, create Scenes via Scripting.
Scene Manager:

Loading a
Scene:
Pass the scene index or it’s name to load it.
Scoring System
Score: Just increase the score with time.
THANK YOU FOR ATTENDING THE SESSION

Common questions

Powered by AI

The Unity Start() function is executed once at the beginning of the scene and is primarily used for initial setup, such as storing values in variables via GetComponent<>(). For example, you might use it to initialize player stats or set initial game parameters. In contrast, the Update() function runs once every frame, making it suitable for updating the game state in real time, such as handling input to move characters or update animations .

Input axes in Unity serve the purpose of providing a convenient way to map user input to game actions, such as moving a character horizontally or vertically. They can be customized by adjusting the key bindings and response curves in the Input Manager to fit specific gameplay mechanics. For instance, additional axes can be created to handle unique gameplay mechanics like diagonal movement or custom camera controls .

In Unity, axes facilitate character movement by mapping user input to directional control, allowing characters to move horizontally or perform actions like jumping based on input from keys or controllers. This creates a seamless method for players to control their characters. Collisions enable interaction with the game world by detecting when characters and objects make contact, allowing for responses such as bouncing off surfaces, collecting items, or triggering events. Together, these concepts enable realistic and interactive character behavior within the game environment .

Menu navigation and scene management are crucial in Unity as they enhance user experience by providing intuitive control and seamless game flow. Menus offer players options such as pausing, restarting, or exiting the game, adding to the gameplay's convenience and accessibility. Scene management allows for smooth transitions between different parts of a game, maintaining immersion and reducing load times by managing resource allocation efficiently. Together, these features help maintain player engagement and satisfaction .

OnCollisionEnter2D() is used to detect physical collisions between objects with Rigidbody components, which is ideal for scenarios where you want objects to interact physically, such as bouncing or stopping upon impact. OnTriggerEnter2D(), on the other hand, is used for detecting when objects enter a trigger zone, which does not affect their physics properties. It is preferred when you want to execute code without altering physical interactions, such as starting a cutscene or triggering an event when a player enters a specified area .

The Instantiate function in Unity creates instances of game objects at runtime, allowing developers to spawn objects dynamically, which can be used for game elements like enemies, power-ups, or projectiles. The Destroy function removes game objects, helping manage memory and keep the game world uncluttered by removing unnecessary objects, such as expired items or defeated enemies. Together, these functions enable dynamic and responsive gameplay environments by constantly updating the scene to reflect the player's actions and game events .

Animations in Unity provide visual feedback and enhance the realism of game characters. They serve to make gameplay more engaging by conveying the motion and actions of characters clearly. Conditional statements like the 'Horizontal' axis influence animation states by triggering animations such as running when the player moves. Ground checks change the animation state to jumping when the player leaves the ground. These conditions ensure animations reflect real-time actions, improving the overall fluidity and coherence of gameplay .

The Start() and Update() functions in Unity complement each other by dividing labor between initial setup and real-time updates. Start() is called once at the beginning of the game or when an object is instantiated, handling initial settings such as configuring character stats, loading assets, or setting initial game states. Update() is called every frame, handling real-time tasks like processing user input, updating animations, or adjusting game logic. This separation ensures efficient initialization and continuous game updates, enhancing both performance and responsiveness .

Raycasting in Unity is used for ground detection by casting rays from the center of a game object to detect collisions with the ground layer. This method is preferred because it provides precise control over measuring distances to the ground and can handle complex geometries. Unlike simpler methods like collision tag detection, raycasting can provide reliable results in dynamic environments with varying terrain and angles .

When choosing a method to develop a game, the main considerations include ease of use, the developer's skill level, and the specific requirements of the game project. Using a game engine is generally preferred because it simplifies the development process by providing integrated tools and features that accelerate development. This allows developers to focus on creativity and design, rather than reinventing basic functionality .

You might also like