Project Report Template (2)
Project Report Template (2)
On
2048 GAME
using C++ Programming Language
Submitted By-
Fariha Tahsin
Roll: 2209016
Features
1. Dynamic Grid Updates:
o A 4x4 grid updates in real-time after each move.
o New tiles (2, 4, 8, 16 or 32) are generated dynamically based on gameplay
progression. For example: First there will be 2 and 4 tile. After five moves,
2, 4 and 8 will be generated. Then after ten moves, 2, 4, 8 and 16 will be
generated randomly.
2
3. Tile Sliding and Merging:
o Will be implemented as modular strategies for each direction (Move_Up,
Move_Down, Move_Left, Move_Right).
Here’s a simple chart that represents the flow of the 2048 game implementation.
3
Proposed Class Structure
1. Grid Class:
o Managing the grid state (a 2D array).
o Initializing the grid.
o Tile Generation: Randomly adding a new tile (2, 4, 8, 16 or 32) to an empty
position after each move.
o Win/ Loss Detection: Detecting when the 2048 tile is created or when no
valid moves are available.
o Grid Display: Formatting and display the grid for a clear user interface.
3. Game_2048 Class:
o Managing the game loop and interactions with the Grid object.
o Accepting user input (W (up), A (left), S (down), D (right), Q(quit)).
o Managing the game state and triggering win/loss conditions.
4
5
Conclusion
This project is a practical implementation of the popular 2048 game using C++ and object-
oriented programming (OOP) principles. The game demonstrates the successful use of key
OOP concepts such as encapsulation, inheritance, polymorphism, and abstraction to create a
clean, modular, and scalable codebase. The console-based design ensures that players enjoy an
interactive and engaging experience, while the modular architecture allows for easy future
enhancements like scoring, undo functionality, or even a graphical interface. This project
highlights how OOP can be effectively used to build robust and maintainable software
solutions.