0% found this document useful (0 votes)
24 views4 pages

ANSWER SCHEME 2d

The document outlines the syllabus for the 2D Game Development course for the B.Sc. Gaming program for the academic year 2024-2025. It includes questions related to Unity's Console window, variable declaration in C#, Sprites, colliders, physics, access specifiers, scene management, and Tile Maps, along with a script for coin collection. The assessment is divided into two parts, with specific marks allocated for each section.

Uploaded by

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

ANSWER SCHEME 2d

The document outlines the syllabus for the 2D Game Development course for the B.Sc. Gaming program for the academic year 2024-2025. It includes questions related to Unity's Console window, variable declaration in C#, Sprites, colliders, physics, access specifiers, scene management, and Tile Maps, along with a script for coin collection. The assessment is divided into two parts, with specific marks allocated for each section.

Uploaded by

dheenadhayalan.p
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

DEPARTMENT OF ANIMATION AND VIRTUAL REALITY

B.Sc. GAMING

Academic Year: 2024-2025


Odd Semester

Subject: 2D GAME DEVELOPMENT

Subject Code: 24BSG1C05

Semester: I
Date: 24/1/24
Q. No Marks
1 MARKS ALLOCATION SCHEME 20
PART - A
1 Answer any FOUR of the following questions. 5X4=20

a Discuss the purpose of the Console window in Unity, and how do you use it to
debug.
Ans. The Console window in Unity is an essential tool for debugging and
troubleshooting errors in a project. It displays log messages, warnings, and error
messages generated during runtime or compilation. Developers use
Debug.Log("Message"); to print messages, Debug.Warning("Warning Message"); for
warnings, and Debug.Error("Error Message"); to indicate errors, helping to track issues
in scripts and game behavior.
b Outline the correct syntax for declaring a variable in C#. Provide examples.
Ans.
In C#, variables are declared using the syntax datatype variableName = value;. For
example, int score = 0; declares an integer variable named score initialized to zero.
Similarly, float speed = 5.5f;, string playerName = "John";, and bool isGameOver = false;
declare float, string, and boolean variables, respectively. Proper variable declaration
ensures structured data handling in Unity scripts.
c Describe the concept of Sprites in Unity.
Ans.
Sprites in Unity are 2D images used to represent characters, objects, and backgrounds
in 2D games. Unity's Sprite Renderer component is used to display and manipulate
sprites in a scene. Developers import images as sprites and use them to create
animations or interactive elements. Sprites can be customized with shaders, materials,
and sprite sheets to optimize performance and create dynamic visuals.
d Discuss the importance of colliders in Unity and their use in game objects with
examples.
Ans.
Colliders in Unity define the physical boundaries of objects, enabling collision detection.
There are different types of colliders, such as BoxCollider2D, CircleCollider2D, and
PolygonCollider2D, which help detect interactions between objects. For example, in a
platformer game, a BoxCollider2D can be applied to a player character to detect ground
collision, preventing it from falling through the floor. Colliders play a crucial role in
physics interactions and game mechanics.
e Describe the role of physics in Unity. How does Unity’s physics engine enhance
gameplay mechanics?
Ans.
Unity’s physics engine simulates real-world physics, making game objects behave
realistically. It provides features like gravity, forces, friction, and collisions. Rigidbody
components allow objects to respond to physics, while forces like AddForce() and
AddTorque() can be applied to objects for movement and rotation. For example, in a
racing game, physics ensures that cars accelerate and drift realistically, improving
gameplay immersion.

Q. No Marks
2 18
MARKS ALLOCATION SCHEME
PART - B
2
Answer any TWO of the following questions. 2X9=18

Evaluate the role of access specifiers in Unity by analysing how they control
a access to class members with examples.
Ans.
Access specifiers in Unity (C#) define the visibility and accessibility of class members.
The primary specifiers are public, private, and protected. public allows access from any
script, private restricts access within the same class, and protected allows access within
the class and its derived classes. For example,

csharp
public class Player {
private int health = 100; // Only accessible within this class
public string playerName = "Hero"; // Accessible anywhere
}
Proper use of access specifiers ensures data encapsulation and security in Unity
projects.

Assess the process of linking multiple scenes in Unity and evaluate the role of the
b required namespace for scene management.
Ans.
Linking multiple scenes in Unity is essential for creating multi-level games. The
SceneManager class from using UnityEngine.SceneManagement; is used for scene
transitions. To load a scene, developers use SceneManager.LoadScene("SceneName");.
For example, when a player completes a level, calling
SceneManager.LoadScene("NextLevel"); loads the next scene. Scene management
ensures seamless navigation between different game levels and menus.

Analyze the concept of Tile Maps in Unity and their contribution to level design in 2D
c games.
Ans. Tile Maps in Unity are used to create 2D game environments using grid-based layouts.
They allow developers to design levels efficiently by placing repeating tiles for backgrounds,
platforms, and obstacles. The Tilemap component, combined with TilemapRenderer,
enables dynamic rendering and efficient memory management. For example, in a side-
scrolling game, a tilemap is used to construct terrains and walls, optimizing performance
while maintaining a visually appealing level structure.
Q. No Marks
3 MARKS ALLOCATION SCHEME 12

3 Answer the following question.

Design a set of steps required to collect a coin in a game and write a script that
a manages the process of collecting the coin.
Ans.
To collect a coin in a game, follow these steps:

Attach a Collider2D to the coin object and set it as a trigger.


Create a script that detects player collision with the coin.
Update the player's score upon collecting the coin.
Destroy the coin object after collection.
Here’s a simple C# script for coin collection:

csharp
Copy
Edit
using UnityEngine;

public class CoinCollector : MonoBehaviour {


void OnTriggerEnter2D(Collider2D other) {
if (other.CompareTag("Player")) {
ScoreManager.instance.AddScore(10); // Increase score
Destroy(gameObject); // Remove the coin
}
}
}
This script ensures that when the player collides with the coin, the score increases, and
the coin disappears from the scene..

Submitted by: DHEENADHAYALAN P

Signature: Signature of the HOD

You might also like