2025-group-11a

2025 COMSM0166 group 11a
🎮 Click this link to play our game!
🎬 Click this link to watch our game video!
đź’» Here are the links to our weekly homeworks.
| week 1 | week 2 | week 3 | week 4 | week 5 | week 7 | week 8 | week 9 | week 10
đź“‹ This is the link to our Kanban board.

Table of Contents

  1. Development Team
  2. Introduction
  3. Requirements
  4. Design
  5. Implementation
  6. Evaluation
  7. Process
  8. Sustainability, ethics and accessibility
  9. Conclusion
  10. References

1. Development Team

team_photo

Image 1: Team Members

| MEMBER | NAME | EMAIL | ROLE | |--------|--------------------|-------------------------|--------------------| | 1 | Yiqing Zhou | lr24125@bristol.ac.uk | Scrum Master, Coder | | 2 | Xing Yang | zj24404@bristol.ac.uk | Optimizer, Coder | | 3 | Cheng Wang | fd24967@bristol.ac.uk | Designer, Coder | | 4 | Jiayi Lin | fg24079@bristol.ac.uk | UI Designer, Coder |
Table 1: Team Members

2. Introduction

classic snakebattle our game

Image 2: Classic Snake Game, Source: analyticsindiamag
Image 3: Snake Battle, Source: Youtube
Image 4: Our Game


This project draws inspiration from one of the most iconic classic games—Snake. However, in contrast to the traditional version, which restricts player movement to four directional keys (up, down, left, right), our goal was to provide a more fluid and intuitive control system on the PC platform. Inspired by the mobile game Snake Battle, where players use a virtual joystick to control the snake’s direction, we designed our version to allow players to guide the snake using mouse input. The p5.js library proved to be particularly suitable for this purpose, as it enables precise mouse-based direction control and allows for the snake’s body to be dynamically rendered using overlapping circles, eliminating the need for external sprite assets.

To enhance the game’s playability, we introduced a variety of power-up food items. When consumed, these items grant temporary buffs such as increased food collection range, short-term invincibility, or enhanced stamina for acceleration. Additionally, we designed multiple maps and difficulty levels, each incorporating unique gameplay mechanics. For example, swamp terrain reduces movement speed, fog limits visibility, and teleportation portals allow for quick relocation to different areas of the map.

An important feature of the game is the inclusion of AI-controlled snakes that compete with the player for food. To maintain balance and competitiveness, AI snakes drop food upon death. Since any collision between a snake’s head and a non-food object results in death, players can strategically eliminate AI opponents to gain additional resources.

3. Requirements

Ideation Process

Each member of our team independently researched game types they were personally interested in. We then came together to share and discuss our findings, evaluating each proposed concept based on feasibility, alignment with team members’ interests, and the potential for scalability within the scope of our project. Through this scoring process, two game types emerged as the highest-rated: side-scrolling platformers and arcade-style games, with Snake as a representative example.

Ultimately, we chose Snake as the foundation for our project. Our primary objective was to focus on enhancing our coding skills and gameplay design abilities, rather than investing a large portion of our time in level or map design, which would have been a significant part of a platformer. The simplicity and extensibility of Snake aligned well with our goal to experiment with control schemes, AI behavior, and game mechanics.

During the ideation phase, we also referenced modern adaptations of the classic Snake game, such as Slither.io and Snake Battle, which inspired us to explore mouse-based controls, dynamic gameplay elements, and multiplayer mechanics. We held structured brainstorming sessions using collaborative tools to consolidate ideas and assess the technical feasibility of each concept, especially within the capabilities of the p5.js library.

Additionally, you may notice that our team was divided into two subgroups, 11a and 11b. This decision arose during the this stage, as we encountered fundamental differences in creative direction that proved difficult to reconcile. To ensure smooth progress and allow each group to pursue its own vision effectively, we mutually agreed to split into two sub-teams and continue the development of two game projects independently.

| Game Genre | Reference Game | Feasibility | Interest | Scalability | Total Score | |-------------------|--------------------|-------------|----------|-------------|-------------| | Side-scrolling Action | Super Mario Bros | 5 | 4 | 5 | 14 | | Arcade | Snake | 5 | 4 | 5 | 14 | | Tower Defense | Plants vs. Zombies | 4 | 4 | 3 | 11 | | Roguelike | Brotato | 4 | 3 | 3 | 10 | | Simulation (Management) | Stardew Valley | 2 | 3 | 2 | 7 | | Scrolling Shooter | Gradius | 5 | 1 | 1 | 7 | | Puzzle | Rusty Lake | 1 | 2 | 4 | 7 | | RPG | Pokémon | 1 | 2 | 4 | 7 | | Simulation (Construction) | Poly Bridge | 1 | 2 | 3 | 6 |
Table 2: Game Research and Game Type Evaluation

User Stories

To clarify the features we could realistically implement and to prioritize our development tasks, we discussed and formulated a series of user stories. The full list can be found in our week 4 assignment. Below are several key stories that had a significant impact on the final deliverable:

“As a player, I want to control the snake using touch or keyboard so that I can play easily.”

“As a player, I want different map modes, such as swamp, desert, and teleportation, each with unique characteristics, so that I can experience varied gameplay.”

“As a player, I want to adjust the game difficulty to match different challenge levels.”

“As a player, I want a timed mode where I can achieve the highest score within a limited time.”

In addition to player-centered stories, we also created developer and UI designer stories to guide the project from a broader perspective:

“As a developer, I want to implement modular managers (e.g., FoodManager, ObstacleManager, ItemManager) so that we can maintain and expand different gameplay elements independently.”

“As a developer, I want to implement AI snakes that can compete with players for food, so the game has an engaging and competitive challenge.”

“As a designer, I want to create a multi-step start menu (snake customization → map → difficulty), so players are guided smoothly into the game.”

“As a designer, I want to implement a victory and game-over screen with reasons (e.g., timeout, collision), so that players receive clear feedback.”

In designing user stories for our Snake Game, we adopted the “As a [user], I want to [goal] so that [reason]” structure to ensure clarity and player-centered design. This method helped us define features that directly address user needs and align with gameplay experience.

We also emphasized writing clear, testable acceptance criteria using the Given-When-Then format. For example, selecting the swamp map slows the snake with water hazards, while the desert mode increases difficulty by reducing food frequency. The teleportation mode repositions the snake across the screen, adding a unique twist. These outcomes help validate functionality effectively during development.

Importantly, we ensured that all user stories were feasible and supported gameplay diversity. Using frameworks like MoSCoW, we prioritized features and focused development on delivering a smooth, engaging experience. This systematic approach improved collaboration and guaranteed a balanced, player-friendly design.

Early Stages Design

Prototype

Image 5: Prototype

To align with our development approach, we referred to the mobile game Snake Battle as our primary design inspiration. Although Snake Battle is a multiplayer online game, our target platform does not support multiplayer functionality. As a result, we had to explore alternative gameplay mechanics to enhance player engagement.

In the early stages of design, we proposed incorporating roguelike elements, including various buff and debuff items—such as candy (which grants a temporary speed boost), cookies (which reveal additional food locations), and trash (which causes damage or unexpected acceleration). We also considered implementing both single-player and two-player modes.

However, as development progressed, we realized that these ideas deviated from the core essence of the classic Snake game and introduced ambiguity in the win conditions, which undermined gameplay consistency. Therefore, we decided to retain only the buff system and the single-player mode, while continuously re-evaluating new gameplay ideas through weekly iteration and testing.

In the first sprint (initial deliverable version), our focus was on faithfully recreating the core mechanics of the reference game: the snake is controlled using the mouse to navigate, consuming food increases its length and score, and the game ends if the snake collides with the map boundary or any obstacle. To increase the level of challenge, we added AI-controlled snakes and obstacles to the map. A collision between the player’s snake head and an AI snake’s body also results in game over. AI snakes compete with the player for food, and in hard mode, food dropped upon the death of AI snakes becomes a crucial scoring resource.

Use-Case Diagram

use-case diagram

Image 6: Use-Case Diagram
</div> We used a use case diagram to preliminarily identify the functional components of the game, helping to provide a clear and intuitive understanding of the required features. During this phase, we held discussions to determine the key use cases of the game and how players would interact with each component. Players engage with the game through a linear interaction flow, starting from a specific screen shown after selecting "Start Game", after which they can choose a map and a difficulty mode. This design allows players to become familiar with the game before challenging themselves further. In addition, each difficulty mode is associated with its own set of components. As players progress, these components increase the challenge within each mode. For instance, the “Swamp” map may extend into a “Slow Speed” challenge, while the “Desert” map could introduce a “Reduced Visibility” mechanic. During gameplay, players are able to move, gain scores, and collect buff items, but may also die if they encounter obstacles. This use case diagram focuses solely on the game’s core gameplay functionality and supports the implementation of the features discussed in the early design phase. Since we adopted an agile development methodology, numerous additional features were introduced later in the project—such as pause functionality, sound effects, and more refined AI snake movement. All of these were integrated without disrupting the structure of the original use case diagram, which continued to serve as a foundation for iterative improvements. ### Requirements Definition We conduct weekly requirement reviews based on the current state of the game to gather additional player feedback, refine gameplay mechanics, and address bugs. This iterative process is also reflected in our Kanban board. The finalized requirements for the deliverable version are as follows:
**1. Game Objective
** The main goal of the game is for the player to control a snake and consume randomly generated food on the map. The player must reach a target score within a limited time in order to win. **2. Player Controls
** The snake’s direction is controlled using the mouse.
The player can accelerate the snake by holding the left mouse button. Acceleration consumes stamina, which is limited and regenerates over time or through specific items. **3. Core Gameplay Mechanics
** Each time the snake consumes a piece of food, its body length increases and the score is incremented.
If the player defeats an AI-controlled snake by colliding with it using their snake’s body (not head), the AI snake is destroyed and additional food or special items are dropped.
The game ends immediately if the player's snake collides with the edge of the map, any obstacles, or the head/body of an AI snake. **4. Power-Ups and Items
** Several power-up items are introduced to enhance gameplay.
**Charge Boost**: Instantly refills the stamina bar, allowing the player to accelerate again.
**Invincibility**: Grants temporary immunity to collisions with obstacles and AI snakes. However, the player can still die if they collide with the edge of the map.
**Foraging Radius Increase**: Temporarily enlarges the effective area around the snake’s head for collecting food, making it easier to gather items. **5. Map Variations and Environmental Effects
** To introduce variety and challenge, the game includes multiple map modes, each with unique effects.
**Swamp Map**: When the snake moves through swamp terrain, its movement speed decreases, and acceleration is less effective.
**Desert Map**: Occasional sandstorms obscure the player's vision, making navigation more difficult.
**Teleportation Map**: Teleportation portals allow the snake to instantly travel to different locations on the map, enabling strategic repositioning.
**6. Difficulty Modes
** **Normal Mode**: Designed for casual gameplay, this mode includes a moderate number of AI snakes, a balanced distribution of obstacles, and a standard amount of food items across the map.
**Hard Mode**: Intended for experienced players seeking a challenge. In this mode, the game initializes with a significantly higher number of AI-controlled snakes, increased obstacles scattered throughout the map, and a reduced frequency of food item spawns. This setting requires more strategic movement and resource management to succeed. **7. Win and Loss Conditions
** **Victory Condition**: The player wins the game by achieving the target score within the allotted time limit.
**Defeat Conditions**: The player loses if they fail to reach the target score in time, or if their snake collides with the map boundary, any obstacle, or an AI-controlled snake. # 4. Design ### Class diagram The class diagram for the Snake Game represents the key components and their relationships. The Snake class serves as the base for PlayerSnake and AISnake, with attributes like body, direction, and movement methods, while PlayerSnake handles user input, stamina, and special states, and AISnake focuses on AI-controlled behavior such as tracking food and avoiding obstacles. The GameMap class manages grid size, borders, and environmental effects, interacting with specialized managers like SwampManager, FogManager, and TeleportManager to generate and process different terrain effects. The ItemManager controls in-game items such as stamina boosts and teleportation, while ObstacleManager generates and manages obstacles like ladders. The FoodManager governs food placement and properties, ensuring AI and player interactions. Enumerations define item types and difficulty modes. This structured design ensures modularity, clear responsibilities, and efficient game management.

class_diagram

Image 7: Class Diagram

### Behavioural diagrams The Snake Rival Game sequence diagram illustrates the game's core logic, including initialization, main loop, and game over handling. The game starts with the user loading the page, then sketch.js calls the setup() function, which initializes the UI, player snake, multiple AI snakes, and managers for food, items, obstacles, and the game map. After the user clicks the "Start Game" button, they select the map type and difficulty level, then the initGame() function is called to complete game initialization. Based on the map type selected, specific elements like swamps, fog areas, or teleportation points are generated.
During the initialization phase, the system sequentially creates the PlayerSnake object, multiple AISnake objects, GameMap object, generates map elements, generates food, and creates a BannerManager for displaying game notifications. During the main game loop (draw()), if the game is not paused, it performs the following operations: the player snake calls updateDirection() and move() methods to update its position, AI snakes call update() and draw() methods to search for food and move, checks various collisions (including with boundaries, obstacles, and other snakes), and updates the BannerManager to display game messages.
When game end conditions are triggered (such as the player colliding with boundaries/obstacles/other snakes, or time running out), the system displays the game over screen. The player can restart the game through mouse interaction. During gameplay, the player controls the snake's direction with the mouse, accelerates with the left-click button; eating food increases the score and length, collecting items grants special abilities.
This sequence diagram provides a structured view of the game's execution flow, covering initialization, frame-by-frame updates, AI behavior, and restart mechanics.

sequence_diagram

Image 8: Sequence Diagram

### Conclusion Snake Rival adopts an object-oriented modular architecture, with the Snake class as the basis, and two subclasses, PlayerSnake and AISnake, derived. PlayerSnake handles user input and special states (invincibility, physical strength, and magnification), while AISnake focuses on AI behaviors such as finding food and avoiding obstacles. The game process starts with page loading, initializing the UI and game components through sketch.js, and calling initGame() after the player selects the map and difficulty to complete the initialization.
The core manager classes include GameMap (handling terrain effects), FoodManager (food management), ItemManager (prop system), ObstacleManager (obstacles), and BannerManager (game notifications). The main game loop (draw()) handles the movement, collision detection, and state updates of the snake until the end condition is triggered.
This structural design ensures a high degree of modularity and clear responsibility allocation, which is convenient for functional expansion and maintenance, while providing a smooth gaming experience and rich interactive mechanisms, such as terrain effects (swamp deceleration, teleportation points) and a variety of special abilities (speed up, invincibility, enhanced detection). # 5. Implementation There are three areas of challenge: ### Challenge 1: Flexible use of mouse to control the snake To enhance the player's sense of control and immersion within the game, we designed and implemented a direction control system based on the position of the mouse cursor. This mechanism continuously listens for mousemove events to retrieve the real-time coordinates of the mouse and calculates a directional vector relative to the current position of the player character. By applying vector normalization techniques, the character is programmed to consistently move in the direction of the mouse pointer, resulting in smooth and natural directional transitions. To prevent sudden angular shifts or jitter during gameplay, we further incorporated a linear interpolation algorithm (commonly referred to as "lerp") to ensure a gradual transition of direction. Specifically, in each frame, the angle between the current orientation and the target direction is smoothly adjusted, producing a gentle turning curve. This approach not only improves the responsiveness of the controls but also enhances the physical coherence of the character’s movement.

Control

Image 9: Control

### Challenge 2: AI enemy snake design To enhance the game's challenge, we designed an AI-controlled enemy snake with capabilities including autonomous pathfinding, obstacle avoidance, target tracking, and player interaction. The most technically demanding aspects of the AI snake implementation lie in path planning and obstacle avoidance. To simulate realistic movement behavior, we adopted a directional vector system combined with linear interpolation via the lerp() function, enabling smoother and more natural turns. To prevent collisions, the AI snake “predicts” whether its next movement step will result in a collision with an obstacle or boundary. This prediction is carried out through the predictCollision() method. If a potential collision is detected, the AI will promptly adjust its direction and attempt to navigate around the obstacle. Furthermore, the target tracking mechanism enhances the AI's strategic behavior. Instead of always pursuing the nearest food item, the AI selects one at random from the three closest food items using the findRandomNearestFood() method. This introduces a degree of unpredictability, thereby increasing gameplay diversity and challenge. Additionally, the AI evaluates the feasibility of pursuing a target based on distance, avoiding ineffective “blind chasing” behavior. Lastly, the interaction with the player and the death feedback mechanism further enrich gameplay dynamics. The AI actively detects collisions with the player's snake: if the player's head collides with the AI's body, the player is defeated; conversely, if the AI's head hits the player, the AI is destroyed. Upon death, the AI snake spawns a number of food items and power-ups proportional to its body length. This design not only increases the game's dynamism but also provides clear reward feedback to the player. To ensure these drops do not overlap or appear in invalid locations, the system shuffles the AI's body segments and applies coordinate offsets during placement.

AI snake

Image 10: AI snake

### Challenge 3: Different maps and terrains To enrich the gameplay experience, we introduced several distinct map types: Swamp, Desert, and Teleport. Each map features unique terrain types and items, along with background color variations to enhance visual diversity. One of the major technical challenges was the terrain generation algorithm. For the swamp and desert regions, we employed a multi-layered Perlin noise approach combined with angular perturbations to produce irregular yet natural-looking organic boundaries. To further enhance the smoothness and visual appeal of these shapes, we applied cubic smoothing techniques and point displacement. The generation of such irregular regions requires both precision in graphical algorithms and a balance between real-time performance and layout diversity, while avoiding overlapping terrain or unreasonable map configurations. Another significant programming difficulty lies in the gameplay mechanics influenced by terrain. For example, when a snake enters a swamp or desert area, its movement speed is significantly reduced. Implementing this behavior necessitates real-time detection of whether the snake's head is within a complex polygon. To achieve this, we implemented a point-in-polygon collision detection algorithm, which involves ray casting and geometric computations. Although the logic is complex, it must operate efficiently to maintain game responsiveness. Additionally, the teleportation system posed a considerable technical challenge. Each teleport portal is randomly paired with a target location. When the snake enters a portal, its entire body must be repositioned to the corresponding target portal while preserving its current movement direction. A cooldown mechanism is also implemented to prevent immediate reactivation. To enhance player feedback and immersion, the teleportation process is accompanied by particle explosion effects, which must be precisely synchronized with the interaction logic to ensure seamless gameplay.

Teleport

Image 11: Teleport

# 6. Evaluation ### Heuristic Evaluation The evaluation team conducted a comprehensive review of the Snake game, identifying multiple issues and scoring them by severity based on Nielsen's usability principles:
Interface Issue Heuristic Frequency Impact Persistence Severity
Starting Lack a description of gameplay mechanics, level selection, and the option to choose between single-player and multiplayer modes Help and Documentation 3 3 4 3.33
Gaming Ai Snake won't die when it touches the player Consistency and standards 4 2 3 3
Gaming Unable to pause the game and unable return to previous step User control and freedom 3 2 3 2.67
Ending Lack of winning conditions Consistency and standards 2 4 2 2.67
Gaming Lack of sufficient game feedback to players Visibility of System Status 2 3 3 2.67
Gaming Background and player snake visually synchronized Aesthetic and minimalist design 3 1 2 2
Gaming Restarting the game doesn't not clear the score Consistency and standards 1 1 1 1
Table 3: Heuristic Evaluation Result
Heuristic evaluation provides us with a systematic, quantifiable list of problems and improvement directions. By categorizing the problems by severity, our team solved the following problems that affect the user experience in order of priority, greatly improving the user experience of the game. | High Priority (Severity > 3) | Medium Priority (Severity 2-3) | Feature Enhancements | |------------------------------|--------------------------------|----------------------| | Add game instructions, level selection, and single/multiplayer mode options | Add a game pause button | Add a health system for the snake | | Fix the logic issue where AI snakes don't die when colliding with the player | Set clear winning conditions (reaching 100 points = win) | Increase food variety with corresponding effects | | | Make snake head more obvious by adding eyes | Add map obstacles | | | Change background design for better visual contrast | Implement speed boost mechanism with stamina bar | | | | Add difficulty modes |
Table 4: Resolved items in order of priority
### SUS SUS is a reliable usability evaluation tool (Brooke, 1986) used to analyze the impact of SNAKE RIVAL's workload and usability at different difficulty levels. **Data Collection and Analysis information about SUS:** - SUS consists of a 10-question survey (raw scores) - Each user completed the SUS form after playing at each difficulty level - The statistical analysis used the Wilcoxon signed-rank test with a significance level of α = 0.05 **Here's the SUS data result:** | User ID | SUS L1 | SUS L2 | |---------|--------|--------| | U1 | 75 | 75 | | U2 | 82.5 | 77.5 | | U3 | 80 | 77.5 | | U4 | 57.5 | 55 | | U5 | 80 | 75 | | U6 | 90 | 80 | | U7 | 80 | 72.5 | | U8 | 57.5 | 57.5 | | U9 | 80 | 75 | | U10 | 67.5 | 65 |
Table 5: SUS data Result
**Data Analysis:** - SUS L1 (lower difficulty): Average score of 75 - SUS L2 (higher difficulty): Average score of 71 - Both scores are higher than 68 (which appears to be a benchmark threshold) - Statistical Analysis showed: * Wilcoxon test result: W test statistic = 0 (n=8, number of non-tied pairs) * Critical value (n=8, α=0.05): 3 * Conclusion: W < 3, indicating a statistically significant difference between difficulty levels **Interpretation:** The L2 SUS score (71) is slightly lower than the L1 score (75), indicating that the increased difficulty of L2 slightly reduces the usability of users' perception and operation of the game system. This difference was found to be statistically significant. Maintaining a balance between difficulty levels and good usability is recommended. ### Black-Boxing Testing **1. Boundary Collision Test** | Test Case | Input | Expected Output | |-----------|-------|------------------| | 1.1 | Player snake in normal state hits the map boundary | Game over, display "You hit the boundary!" | | 1.2 | Player snake in invincible state hits the map boundary | Game continues, player takes no damage | | 1.3 | Player snake approaches but does not touch boundary | Display boundary warning effect, game continues |
Table 6: Boundary Collision Test cases
**2. Obstacle Collision Test** | Test Case | Input | Expected Output | |-----------|-------|------------------| | 2.1 | Player snake in normal state hits an obstacle | Game over, display "You hit an obstacle!" | | 2.2 | Player snake in invincible state hits an obstacle | Game continues, player takes no damage |
Table 7: Obstacle Collision Test cases
**3. Snake-to-Snake Collision Test** | Test Case | Input | Expected Output | |-----------|-------|------------------| | 3.1 | Player snake in normal state hits AI snake body | Game over, display "You hit another snake!" | | 3.2 | Player snake in invincible state hits AI snake body | Game continues, player takes no damage | | 3.3 | AI snake head hits player snake body | AI snake dies, random number of food and items spawn, display "SNAKE DEFEATED!" banner |
Table 8: Snake-to-Snake Collision Test cases
**4. Food Collision Test** | Test Case | Input | Expected Output | |-----------|-------|------------------| | 4.1 | Player snake in normal state touches food | Snake length increases, play eating sound effect, score increases | | 4.2 | Player snake in expanded detection range state approaches food | Snake collects food without direct contact, length increases, play eating sound effect, score increases |
Table 9: Food Collision Test cases
**5. Item Collision Test** | Test Case | Input | Expected Output | |-----------|-------|------------------| | 5.1 | Player snake touches invincibility item | Invincible state activated, display banner, play item sound effect | | 5.2 | Player snake touches stamina item | Stamina restored, display banner, play item sound effect | | 5.3 | Player snake touches range expansion item | Expanded detection range state activated, display banner, play item sound effect |
Table 10: Item Collision Test cases
**6. Special Map Features Test** | Test Case | Input | Expected Output | |-----------|-------|------------------| | 6.1 | Player snake enters swamp area | Snake movement speed is reduced | | 6.2 | Player snake enters teleport point | Snake is teleported to the corresponding target point, teleport effect and message shown |
Table 11: Special Map Features Test cases
### Conclusion The evaluation of Snake Rival provided comprehensive insights using multiple methods. The heuristic evaluation identified several key usability issues, the most serious of which included a lack of game instructions and issues with AI snake collision detection logic. The development team systematically addressed these issues by priority, implementing game instructions, fixing collision logic, adding a pause function, and establishing a clear win condition (100 points to win).
The System Usability Scale (SUS) evaluation showed high usability scores for both difficulty levels, with low difficulty (L1) at 75 points and high difficulty (L2) at 71 points, both above the baseline threshold of 68 points. Statistical analysis confirmed significant differences between difficulty levels, indicating that increasing difficulty slightly reduced usability.
Black box testing validated the core mechanics of the game, including boundary collision, obstacle interaction, snake-snake collision, food collection, power-up, and special map features. These tests confirmed the proper functioning of the game in various scenarios, including the proper functioning of the invincibility state, the stamina system, and the enhanced food detection mechanic.
The combination of these evaluation methods guided effective improvements to Snake Rival, making the game more user-friendly, balanced, and fun, while maintaining an appropriate level of challenge across different difficulty settings.
# 7. Process ### Division of Work & Collaboration **1. Division of Work** At the beginning of the project, our team held a detailed discussion on task allocation. Since all members expressed strong interest in programming, we decided that everyone would participate in the development of core functionalities. Other responsibilities were assigned based on each member’s strengths: - **Cheng**, as an avid gamer, has a good understanding of gameplay mechanics and user experience. He was mainly responsible for the design of game mechanics. - **Xing**, who previously worked as a product manager, is familiar with feature validation and user experience optimization. She took charge of testing and also participated in code reviews. - **Jiayi**, with a background in art and design, was in charge of the UI, including elements such as menus, help pages, and background visuals. - **Yiqing** demonstrated strong organizational and coordination skills and therefore took the role of project manager, responsible for overall progress tracking, task delegation, and project coordination. **2. Agile Software Development** We adopted the methodology of Agile Software Development, which proved to be particularly suitable given the team’s relatively limited programming experience and the small scale of the project. Each week, we set clear short-term goals and adjusted our plans flexibly based on the previous progress and feedback. Compared with the traditional Waterfall Development Model, our process focused more on continuous user feedback and iterative improvements rather than rigidly following an initial plan to perfection. Additionally, we embraced the concept of Minimum Viable Product — implementing the core gameplay first, followed by iterative extensions and optimizations. Feedback was mainly gathered from internal playtesting among group members and comments received during in-class demonstrations. We carefully incorporated this feedback into the development cycle to ensure a continuously improving game experience. **3. Pair Programming** To improve code quality and minimize errors, we frequently adopted pair programming. This strategy was particularly effective for a team like ours, where members had limited experience but strong willingness to collaborate. For instance, in the module led by Cheng and Xing, Cheng focused on logic design and core code implementation, while Xing provided ongoing optimization suggestions and later carried out thorough testing and validation. The close collaboration ensured a higher degree of accuracy and efficiency in the final output. **4. Frequent and Efficient Meetings** Throughout the project, we held meetings approximately every three days to review progress, resolve any issues, and assign new tasks. These meetings were kept brief yet efficient. We utilized the Planning Poker method to estimate the workload and complexity of each task. This technique enabled the team to achieve a fair and reasonable distribution of tasks and ensured that all assignments matched each member’s capability. ### Tools **1. GitHub** Each team member used GitHub for version control throughout the development process. Every contributor developed their assigned modules in a separate branch. Before merging any development branch into the main branch, a Pull Request was created and reviewed by Xing, ensuring code quality and maintaining a stable main branch at all times. We merged into the main branch weekly. Bugs and feedback issues are also logged via GitHub.

github

Image 12: github

**2. Temporary Google Shared Document** We used a Shared Document to record outcomes from lab discussions, as well as ideas and task distributions discussed during each meeting. The shared document allowed real-time viewing and editing, greatly improving collaboration efficiency and transparency. **3. Kanban Board** Project management was mainly conducted using our [Kanban board](https://yiqing.atlassian.net/jira/software/projects/DP/summary). Yiqing was responsible for updating task statuses on a weekly basis, which included the categories “To Do,” “In Progress,” and “Completed.” Our team started working on the project in Week 6, which was relatively late compared to other groups, giving us a tighter schedule. The Kanban board helped us stay organized and on track under pressure. Weekly deadlines were set for Monday so that we could learn new topics in Tuesday’s lab session and then assign new tasks after class.

kanban

Image 13: kanban

**4. Online Meeting and WeChat Group** Most of our regular discussions took place online using Tencent Meeting. Screen sharing was frequently used to collaboratively debug. We also created a WeChat group, which served as the main channel for quick updates, Q&A, and file sharing. It played a key role in maintaining fast and effective communication. ### Reflection Looking back on the entire project process, our team demonstrated a high level of collaboration efficiency, with well-organized task allocation and effective progress management, resulting in the successful development of an ideal game. Each member made significant contributions and fully experienced the complete cycle of project development. # 8. Sustainability, ethics and accessibility ### Environmental Impact Our *Snake Rival* game demonstrates strong environmental sustainability through several key design choices and technical implementations. **Energy Efficiency:** We have implemented multiple green software patterns to minimize energy consumption. The game uses `frameRate(30)` to cap rendering at 30 frames per second, significantly reducing unnecessary CPU/GPU cycles while maintaining smooth gameplay. This can lower energy usage by up to 40% compared to uncapped frame rates. AI snakes are reused after death instead of being recreated, minimizing memory allocation and garbage collection cycles. This reduces the high energy cost of frequent object creation and destruction. Centralized managers for food, obstacles, and power-ups (Singleton Resource Managers) prevent redundant resource allocations, improving memory efficiency. **Carbon Awareness:** Although currently a local offline game, we’ve designed the architecture to support future carbon-aware features. These include a potential “Green Mode” that adjusts graphical fidelity based on the local grid’s carbon intensity, dynamic performance scaling to reduce energy usage during high-carbon periods, and zero data transmission by avoiding online features and logins. **Resource Optimization:** Our web-based implementation using **p5.js** ensures no physical materials or distribution logistics are required. It supports adaptive rendering based on device capabilities and has been tested on Windows, Linux, and Android. Additionally, efficient collision detection algorithms (for food, power-ups, AI snakes, obstacles, and boundaries) help reduce computational load. ### Individual Impact Our game prioritizes player health and well-being through multiple user-friendly design elements. **Health Considerations:** Customizable snake colors and map themes reduce eye strain, with swamp and desert themes offering low-contrast, soothing palettes. Rich sound effects and background music enhance immersion without being overwhelming. Planned improvements include periodic health reminders and optional forced pauses to prevent overplay. **Privacy Protection:** We fully implement Privacy by Design principles. The game collects no personal data. No login, user account, or profile is required, no gameplay data is stored or tracked—each session starts fresh—and no third-party analytics or advertising tools are used. **Accessibility Features:** Current accessibility implementations include simple mouse-based controls suitable for all ages, clear visual and audio feedback for all in-game events, and two difficulty levels (Normal and Hard) to accommodate different skill levels. Planned improvements inspired by WCAG include a high-contrast mode or maps for visually impaired players and screen reader compatibility for navigating menus. ### Social Impact Though primarily a single-player experience, our game design also considers broader social factors. **Inclusivity:** There are no language barriers as gameplay is fully visual and menus use basic English. There are no cultural references, as the snake protagonist is universal and inclusive. There are no competitive elements, removing negative social pressure, and no age-restricted or inappropriate content, making it safe for all ages. **Educational Value:** The game enhances hand-eye coordination and strategic thinking for players. For developers, the clean code structure showcases sustainable software architecture. It also highlights responsible use of environmental assets, such as swamp and desert ecosystems. ### Ethical Considerations We’ve addressed several ethical concerns during the game’s design process. **Algorithmic Fairness:** AI snakes operate on simple, transparent rules with no opaque machine learning or hidden difficulty adjustments that could cause frustration. **Responsible Design:** The game contains no addictive mechanics or variable reward loops. Win/lose conditions are clearly defined, with each session limited to a maximum of 120 seconds. There is no monetization or in-app purchases that could exploit players. **Transparency:** All game mechanics are intuitive and explained through gameplay. Basic instructions are available via the in-game Help screen, and the open-source code makes all implementation logic fully inspectable. ### Conclusion and Future Improvements Our *Snake Rival* game exhibits strong sustainability across environmental, individual, and social dimensions. Even as a simple game, it embraces thoughtful green software practices. **Key Strengths:** The game achieves excellent energy efficiency through frame rate limiting and object reuse. Privacy is built-in from the ground up, with no data collection or accounts. Accessibility is already supported at a baseline level, with plans for further expansion. The game is ethically designed, with no manipulation or monetization. **Planned Enhancements:** We plan to add dynamic performance scaling across devices (PC, tablet, mobile), local multiplayer support without requiring internet connectivity, and an extension of carbon-aware features as needed. This project shows that even small games can be built with sustainability in mind. The green software patterns applied here are practical, effective, and adaptable—setting an example for responsible game development. # 9. Conclusion The Snake Rival game project marks a significant milestone in our academic and professional development, demonstrating both technical achievement and collaborative growth within our four-member team—Yiqing Zhou, Xing Yang, Cheng Wang, and Jiayi Lin. Beginning as a simple snake game prototype, the project gradually evolved into a feature-rich, engaging gaming experience through the integration of AI opponents, multiple map environments, power-up systems, and sophisticated collision mechanics. This transformation challenged us to effectively apply object-oriented programming principles, establishing structured class hierarchies for different snake types (PlayerSnake, AISnake, AutoSnake) and managing key game elements through dedicated managers such as FoodManager, ObstacleManager, and ItemManager. Throughout this process, we not only enhanced our programming skills but also deepened our understanding of software engineering practices, iterative development, and team coordination. Our success stemmed from the complementary skill sets within the team and the clear distribution of responsibilities. Yiqing Zhou took on the role of project leader, ensuring that tasks were well-coordinated and project milestones met. Xing Yang focused on debugging and the technical implementation of core game mechanics and collision systems, while Cheng Wang designed item systems and power-up mechanics that gave the game its distinctive variety and strategy. Jiayi Lin contributed through visual design, creating user interface components, visual effects, and enhancing the overall user experience. We adopted an agile workflow, holding weekly stand-up meetings and managing our codebase through GitHub. This structure allowed us to break down the project into manageable components, assign tasks based on individual strengths, conduct regular code reviews, and merge features systematically. Through this, we gained valuable lessons about clear communication, constructive feedback, balancing creative ideas with technical feasibility, and maintaining consistent coding standards within a collaborative environment. Technically, several challenges tested our problem-solving abilities and resilience. AI pathfinding was one of the most difficult aspects, requiring intelligent behavior for AI-controlled snakes that could navigate the environment effectively, pursue food, avoid obstacles, and react dynamically to other snakes. Our final approach combined food targeting with obstacle avoidance, predictive collision detection, and behavioral state machines. Performance optimization was another key area, where we addressed frame rate drops by implementing object pooling for AI snakes, setting frame rate limits, and using efficient collision detection algorithms. The development of a multi-map system also introduced complexity, as each environment—Default, Swamp, Desert, and Portal—needed distinct mechanics, unique visual elements, and consistent physics behavior. Managing different game states, such as the main menu, gameplay, pause, and game over, required careful event handling and logical state transitions, which taught us the importance of comprehensive testing and prototyping. Beyond technical challenges, this project provided invaluable professional development experiences. We learned the importance of writing modular, well-documented code that could be easily understood and maintained by others. Using Git effectively for collaborative development, resolving merge conflicts, and performing code reviews became essential habits. Balancing this project alongside other coursework taught us to set realistic milestones, prioritize critical path features, and allocate buffer time for debugging. Additionally, we implemented a quality assurance process through peer code reviews, organized playtesting sessions, and incorporated automated testing where feasible. User experience emerged as a key focus, with feedback from playtesters leading to refinements in difficulty progression, visual feedback, and control responsiveness. Looking ahead, we have identified several future improvement opportunities. Technically, adding networked multiplayer functionality, procedural map generation, a replay/spectator system, and additional AI behavior patterns would significantly enhance the game’s depth and replayability. In terms of content, expanding map themes, introducing new environmental effects, adding power-up types, and offering customizable snake skins could further enrich the player experience. Performance optimization could also be refined through techniques like spatial partitioning and implementing Level of Detail (LOD) systems. We also recognize the importance of accessibility, and future versions of the game could benefit from colorblind modes, adjustable control schemes, and customizable difficulty settings. In conclusion, the Snake Rival project transformed our understanding of game development and software engineering, highlighting that successful projects require far more than just technical expertise. Effective communication, the ability to explain complex technical concepts, openness to integrating diverse ideas, and persistence in debugging complex systems all proved equally vital. We learned how to balance creative vision with practical constraints, and how teamwork can produce results that exceed the sum of individual contributions. This project served as a valuable practical application of our coursework in Software Engineering Discipline and Practice, reinforcing core principles while challenging us to address real-world development problems. The lessons we gained in collaborative development, systematic problem-solving, and maintaining user-focused design will undoubtedly benefit us as we continue our studies and pursue future professional opportunities. # 10. References ### Contribution Statement
| MEMBER | SCORE | EMAIL | CONTRIBUTION | |----------------|-------|------------------|-------------------| | Yiqing Zhou | 25% | lr24125@bristol.ac.uk | **coding**: overall game architecture, basic gaming functionality, scoring methods, winning and dying decisions, ai snakes moving logic, interface logic, difficulty settings and timers, swamp terrain, bug fixes, code refactor
**report**: introduction and requirements
**scrum master**: follow up on progress, organize meetings and assign tasks to team members
**video**: writing the script| | Xing Yang | 25% | zj24404@bristol.ac.uk | **coding**: OOP code architecture, basic gaming functionality, snake base class definition, architecture and logic of playersnake, interaction between playersnake and AI snake, teleport terrain, desert terrain, banner prompts mechanism, bug fixes
**report**: design and evaluation
**optimizer**: write test cases, test before code submission, discover and manage game bugs, and optimize game mechanics
**video**: write detailed scripts and plan storyboards | | Cheng Wang | 25% | fd24967@bristol.ac.uk | **coding**: prop and obstacle, map boundary warning effect, return logic for game menus and button animations, addition of sound effects and background music, partial involvement in debugging.
**report**: sustainability and conclusion
**designer**: designed core gameplay mechanics, such as winning conditions and difficulty settings.
**video**: animation, sounds and video editing.| | Jiayi Lin | 25% | fg24079@bristol.ac.uk | **coding**: basic game functionality, border and snake movement, different backgrounds, snake appearance optimization, font style, menu, main interface animation, help page, interface logic, bug fixes
**report**: implementation and process
**UI Designer**: drawing maps as backgrounds, snake appearance design, interface design
**video**: filming and dubbing|
Table 12: Contribution