2D and 3D games
- Game Development course
- Beginner
- Lesson 3/83
- 4 min
Learn the differences between 2D and 3D games and their approaches.
2D Games
2D games are created in a two-dimensional world. Object positions in this world are generally represented using horizontal and vertical axes. Characters and objects are often represented by two-dimensional images called sprites.
Y
↑
|
| ● Character
|
+----------→ XPlatform and puzzle games can be developed using a 2D approach.
3D Games
3D games are created in a three-dimensional world. Objects have three position axes: horizontal, vertical, and depth. Characters, buildings, and environment objects are often built using three-dimensional geometric models called meshes.
Z (Depth)
/
● Character
/
+----------→ X
|
|
↓ YWith a 3D approach, objects can be viewed from different angles and create a sense of depth.
Practice Print the Type of a 2D Object
To identify a character's visual type in a 2D game, assign the value sprite to the objectType variable and print it.
Starter code
// 2D karakterin görsel türü
const objectType = "";
// Nesne türünü ekrana yazdırSample solution
// 2D karakterin görsel türü
const objectType = "sprite";
console.log(objectType);Expected output
sprite
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which element is commonly used to represent a character's visual appearance in a 2D game?
- Three-dimensional camera
- Audio file
- Sprite Correct answer
- Mesh
Explanation: A sprite is a two-dimensional image that represents characters and other visual objects in 2D games.
2 Identify the Three-Dimensional Model
const objectType = "____";
console.log(objectType);
const objectType = "mesh";
console.log(objectType);
Explanation: A mesh represents the geometric structure of three-dimensional objects.
3 2D and 3D Concepts
| Term | Meaning |
|---|---|
2D |
Two-dimensional game approach |
3D |
Three-dimensional game approach |
Sprite |
Two-dimensional visual |
Mesh |
Three-dimensional geometric model |