0% found this document useful (0 votes)
13 views12 pages

Game Report

The document outlines a course project for a game called 'CỐ LÊN', which is based on the popular puzzle game 2048, featuring a color progression mechanic instead of numerical tiles. It details the game's functional and non-functional requirements, implementation methodology using Unity 2D, and various gameplay mechanics including tile merging and special tiles. The project aims to maintain the strategic depth of 2048 while providing a visually distinct and engaging experience through its unique gameplay features.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views12 pages

Game Report

The document outlines a course project for a game called 'CỐ LÊN', which is based on the popular puzzle game 2048, featuring a color progression mechanic instead of numerical tiles. It details the game's functional and non-functional requirements, implementation methodology using Unity 2D, and various gameplay mechanics including tile merging and special tiles. The project aims to maintain the strategic depth of 2048 while providing a visually distinct and engaging experience through its unique gameplay features.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

VIETNAM NATIONAL UNIVERSITY, HO CHI MINH CITY

UNIVERSITY OF TECHNOLOGY
FACULTY OF COMPUTER SCIENCE AND ENGINEERING

GAME PROGRAMMING (CO3045)

Course project

"CỐ LÊN" (2048 based)

Instructor(s): Phan Trần Minh Khuê

Students: Lưu Hoàng Thảo Linh - 2152720


Lê Thị Thúy Hằng - 2052460

HO CHI MINH CITY, DECEMBER 2024


University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Contents
List of Figures 3

List of Tables 3

1 Introduction 3
1.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Literature review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Development requirements 5
2.1 Functional requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.1 Core gameplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.2 User interface (UI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.3 Input handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Non-functional requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Implementation 7
3.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.1 Game Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.2 Tile Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.3 Game Board Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.4 Player Input and Movement . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.5 Tile Merging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.6 Game Over Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.7 Score Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.8 Visual Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

4 Conclusion and future works 10


4.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2 Future works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

References 11

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 1/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

List of Figures
1 CỐ LÊN gameplay screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 The original 2048 gameplay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Development Process Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Game Over screen appears when having no moves . . . . . . . . . . . . . . . . . 7

List of Tables
1 Input handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Core gameplay mechanics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 User Interface (UI) and User Experience (UX) . . . . . . . . . . . . . . . . . . . 10

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 2/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

1 Introduction
1.1 Description

Figure 1: CỐ LÊN gameplay screen

2048 is a highly popular puzzle game developed by Italian web developer Gabriele Cirulli.
The game was first released on March 9th, 2014. Despite being developed in just one weekend,
2048 quickly captured global attention due to its elegant simplicity and addictive mechanics. The
goal of the game is straightforward: players slide numbered tiles across a grid, merging tiles with
the same value to create new ones. The ultimate objective is to produce a tile with the value
of 2048. With its easy-to-learn rules and the challenge of strategic thinking, the game became a
global phenomenon and a benchmark in casual puzzle gaming.
Our game, "CỐ LÊN," adapts the core mechanics of 2048 by replacing numerical tiles with
a color progression. Instead of merging numbers to double their value, players combine colored
tiles through the spectrum: red → orange → yellow → green → blue → indigo → violet.
A key difference is the introduction of two special tiles. Merging two violet tiles creates
a multicolor block that clears the entire grid and resets the progression to red. Additionally,
surpassing violet unlocks a "rainbow block" which also clears the board but resets the progression
to level 2. These mechanics prevent game stagnation by providing opportunities to clear the board
and continue playing.
This color-based adaptation maintains the strategic depth of the original 2048 while offering
a visually distinct and engaging experience. The reset mechanics differentiate "CỐ LÊN" from
the original by addressing the common issue of running out of moves, thus keeping the gameplay
dynamic.

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 3/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

1.2 Literature review


The game 2048, created by Gabriele Cirulli, has become a widely recognized and popular puzzle
game since its release in 2014. Its simple yet addictive gameplay, based on combining numbered
tiles on a grid to reach the 2048 tile, has inspired numerous variations and adaptations.

Figure 2: The original 2048 gameplay

The original 2048 game [2] is played on a 4x4 grid. The player can swipe in four directions
(up, down, left, right) to move all tiles in that direction. When two tiles with the same number
collide, they merge into a single tile with double the value. The game continues until the player
reaches the 2048 tile (or higher) or there are no more possible moves (i.e., no adjacent tiles with
the same value and no empty spaces).
Key aspects of the original game include:
Simple Rules: The rules are easily understood, contributing to the game’s broad appeal.
Emergent Complexity: Despite the simple rules, the game presents strategic depth, requiring
players to plan ahead and anticipate future moves. Addictive Gameplay: The combination of
simple rules, strategic depth, and the satisfaction of merging tiles creates a highly engaging

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 4/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

experience.

1.3 Methodology
The software process methodology to be used would be “Component-based” since the IDE or
Game Engine which would be used is Unity 2D. Unity 2D uses component-based programming
and supports C or Java-Script as a scripting language. Although C is an object-oriented language,
Unity 2D uses it as a scripting language and combines it with the game components to complete
the component-based method.
Even if one can prepare a well-thought-out design document, some features do not give
the same effect in gameplay as on the paper. During implementation phase many features are
added, removed, or modified. Accordingly, one needs to make some modifications on game design
and requirement analysis. Thus, one of the most suitabledevelopment methodologies for game
development is iterative development process.Most of game developers have the same idea about
the advantages of iterativedevelopment process for game developers.

Figure 3: Development Process Model

2 Development requirements
2.1 Functional requirements
2.1.1 Core gameplay
• Grid Display: The game shall display a grid of tiles, typically 4x4.
• Tile Generation: The game shall randomly generate new tiles (typically 2 or 4) in empty
spaces on the grid at the start of the game and after each move.

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 5/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

• Movement: The player shall be able to move all tiles simultaneously in one of four direc-
tions (up, down, left, right).

• Merging: When two tiles with the same value collide during a move, they shall merge into
a single tile with double the value.
• Scoring: The game shall keep track of the player’s score. The score shall increase by the
value of the merged tiles.
• Game Over Condition: The game shall end when there are no more possible moves (i.e.,
no adjacent tiles with the same value and no empty spaces).
• Win Condition (Optional): The game may have a win condition, such as reaching a tile
with the value 2048 or a higher target value.

2.1.2 User interface (UI)


• Game Screen: The game shall display the grid of tiles, the current score, and potentially
other information such as the highest tile reached.
• Game Over Screen: The game shall display a game over screen when the game ends,
showing the final score and potentially options to restart or return to the main menu.
• Score Display: The game shall display the current score clearly and update it after each
successful merge.

• Restart Option: The game shall provide an option to restart the game from the current
screen or the game over screen.
• High Score Tracking: The game will store and display high scores.

2.1.3 Input handling


• Keyboard Input (Desktop/Web): The game shall respond to arrow key presses for move-
ment.

2.2 Non-functional requirements


• Usability: The game shall respond to swipe gestures on mobile devices with a recognition
accuracy of at least 95%, ensuring that the intended swipe direction is correctly interpreted.
• Performance: Tile merging animations shall be rendered at a minimum frame rate of 30
frames per second on target mobile devices to provide a smooth visual experience.

• Clear Visual Feedback: The game should provide clear visual feedback to the player,
such as smooth tile animations during movement and merging, clear score updates, and a
distinct visual indication of the game over state.
• Easy to Understand Interface: The game interface should be clean, uncluttered, and
easy to understand. The score should be prominently displayed, and any other game ele-
ments (like restart button, undo button) should be clearly labeled.
• Consistent Design: The game should maintain a consistent visual style throughout, in-
cluding consistent font usage, color schemes, and tile design.

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 6/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

3 Implementation
3.1 Modules
The game application has been developed using Unity, designed to run on PC platforms, with
player movement controlled via the arrow keys for seamless navigation.

Figure 4: Game Over screen appears when having no moves

3.1.1 Game Initialization


The game is orchestrated by the GameManager class, which assumes responsibility for initializing
the game state, encompassing the score and the game board. Upon the commencement of a new
game, the score is reset, the high score is retrieved, and the game board is cleared and populated
with two initial tiles.

3.1.2 Tile Representation


Each tile is encapsulated by the Tile class, which maintains its state, position, and visual rep-
resentation. The state of a tile is defined by the TileState class, which encompasses attributes
such as the tile’s numerical value, background color, and text color. Tiles can be spawned, moved,
and merged in accordance with player input.

3.1.3 Game Board Structure


The game board is governed by the TileBoard class, which comprises a grid of TileCell objects.
Each cell can either be occupied by a tile or remain vacant. The board is tasked with processing
player input, facilitating tile movement in the designated direction, and executing tile merges.

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 7/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

3.1.4 Player Input and Movement


The game responds to player input via keyboard controls (WASD or arrow keys). Upon the
pressing of a key, the TileBoard class interprets the input to ascertain the direction of movement.
Tiles are maneuvered in the specified direction until they either collide with another tile or reach
the periphery of the board.

3.1.5 Tile Merging


When two tiles of identical value collide, they are capable of merging into a singular tile whose
value equals the sum of the two original tiles. This merging process is managed by the MergeTiles
method, which concurrently updates the score. The merged tile adopts the properties of the new
state delineated in the TileState array.

3.1.6 Game Over Condition


The game persists until no valid moves remain. The CheckForGameOver method assesses the
current state of the board to determine if any moves or merges are feasible. In the absence of
available moves, the game transitions to a game-over state, wherein the player is presented with
a game-over screen.

3.1.7 Score Management


The game maintains a score that escalates whenever tiles are merged. The GameManager class
oversees score updates and high score tracking utilizing Unity’s PlayerPrefs for persistent stor-
age.

3.1.8 Visual Feedback


The game furnishes visual feedback through animations and user interface updates. The Fade
coroutine within the GameManager class is employed to display the game-over screen, while tile
movements and merges are animated to ensure a seamless user experience.

3.2 Evaluation

Table 1: Input handling

Attribute
No. Test case Expected Result Result
andvalue
Using input The tiles will move
Player controller
manager to use according to the input
1 are working Passed
input keys: W, A, provided to the input
correctly
S, D to move manager by the user

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 8/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Table 2: Core gameplay mechanics

Attribute
No. Test case Expected Result Result
andvalue
The tiles merge into one
Two adjacent
tile with double the value
Merge two tiles with the
1 (e.g., a 4), and the score Passed
identical tiles same value (e.g.,
increases by the merged
two reds)
tile’s value
Two adjacent
Attempt to merge tiles with
2 No merge occurs Passed
two different tiles different values
(e.g., a 2 and a 4)
Tiles merge
through red →
Merge tiles The tiles change color
orange → yellow
3 through the entire correctly according to the Passed
→ green → blue
color sequence defined sequence
→ indigo →
violet
Tiles are adjacent Tiles move as far as
Move tiles
4 to the edge of the possible towards the wall Passed
towards a wall
grid and stop
Tiles move as far as
Move tiles with Tiles have other
possible until they
5 other tiles tiles in their path Passed
encounter the obstructing
blocking the path of movement
tiles
The grid is full,
The game ends, and the
No more possible and no adjacent
6 game over screen is Passed
moves tiles have the
displayed
same value
The rainbow block
Reach the Merge two violet appears, and using it clears
7 Passed
rainbow tile tiles the entire grid and resets
the progression to red.
Merge two Two adjacent
8 identical rainbow rainbow-colored The game board clears Passed
tiles tiles

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 9/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

Table 3: User Interface (UI) and User Experience (UX)

Attribute
No. Test case Expected Result Result
andvalue
The score is updated
Merge tiles and Tiles merge
1 correctly, reflecting the Passed
observe the score successfully
value of the merged tiles
User interacts
Click/tap the
with the "bấm The game restarts with a
"bấm vào đây để
2 vào đây để thấy new grid and a score of Passed
thấy điều bất
điều bất ngờ" zero
ngờ" button
button
User quickly
The game responds to all
presses multiple
Rapidly input inputs correctly and
3 movement keys or Passed
move commands smoothly, without lagging
performs multiple
or skipping moves
swipes
Tiles are clearly
Observe tile
Game running distinguishable, the grid is
4 colors/numbers Passed
normally well-defined, and the score
and grid layout
is easily readable

4 Conclusion and future works


4.1 Conclusion
yes

4.2 Future works


To expand the game’s appeal, we plan to introduce new map layouts beyond the default square
grid. For instance:
• Triangular Grid: A unique layout that challenges players to think beyond conventional
linear movement.
• Hexagonal Grid: This introduces six directions of movement, creating a fresh and complex
gameplay dynamic

These features, combined with customizable difficulty levels and artistic themes, will make
the game stand out in the puzzle game market. ...

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 10/11
University of Technology, Ho Chi Minh City
Faculty of Computer Science and Engineering

References
[1] Alihossein Fazeli and Nikolaos Mavridis. “Probabilistic robotic logic programming with
hybrid Boolean and Bayesian inference”. In: ResearchGate (2023). url: https : / / www .
researchgate.net/publication/374165399_Probabilistic_robotic_logic_programming_
with_hybrid_Boolean_and_Bayesian_inference.
[2] Ahmad Mufid Zakaria and Muhammad Lutfi. “Smart Farming Using Robots in IoT to
Increase Agriculture Yields: A Systematic Literature Review”. In: Jurnal Riset Cendekia
4.3 (2023), pp. 1–15. url: https://doi.org/10.18196/jrc.v4i3.18368.

Assignment for Mathematical Modeling - Academic year 2022 - 2023 Page 11/11

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy