# 🎮 Test Project: Module C - CyberTyper 2026

## 1. Project Overview
The objective of this task is to develop a high-performance arcade game based on English typing. Competitors must analyze the provided `words_data.json` file to design a **Database (MySQL)** and complete a dynamic front-end engine that tracks real-time coordinates to destroy words by integrating it with an API.

## 2. Technical Definitions
* **VFX (Visual Effects)**: Visual special effects within the game. This refers to effects such as letters breaking into fragments upon bullet collision.
* **WPM (Words Per Minute)**: An index of typing speed. (Calculation: `Total words typed / Play time in minutes`)
* **HP (Health Point)**: The player's vitality (starting at 100%). It decreases when words are missed, and the game ends when it reaches 0%.

## 3. Step 1: Backend API and Database Design (Server-side)
All API endpoints must use the `/module_c/api/` path, and data persistence must be guaranteed.

### **A. Database Configuration (Mandatory)**
* **Word Table**: You must create a table that stores the word text, difficulty level, and unique points based on the contents of the provided `words_data.json`.
* **Ranking Table**: You must design a table to store player names, final scores, and max combos. This data must be maintained even after a server restart.

### **B. API Logic Requirements**
* **Word Supply API (`GET /module_c/api/words?level=n`)**: 
    1. Randomly extract words corresponding to the requested difficulty (`level`).
    2. **Duplicate Prevention**: Words already appearing on the current game screen must not be duplicated in the API call.
* **Ranking API**: Records must be stored in the DB via `POST` requests, and the **Global TOP 5** records must be returned in descending order of score upon `GET` requests.

## 4. Step 2: Game Engine and Scoring Logic (Front-end Development)

### **A. Difficulty Settings (Spawn Interval & Fall Speed)**
Words are generated at **random horizontal positions** at the top of the screen (y=0) and move downwards.

| Difficulty (Level) | Spawn Interval | Fall Speed | Multiplier ($Multiplier$) |
| :--- | :--- | :--- | :--- |
| **Level 1** | Every 2.0s | Slow (50px/sec) | 1.0 |
| **Level 2** | Every 1.5s | Normal (80px/sec) | 1.5 |
| **Level 3** | Every 1.0s | Fast (120px/sec) | 2.0 |

### **B. Detailed Scoring Formula ($FinalScore$)**
$$FinalScore = BasePoints + (CurrentCombo \times LevelMultiplier)$$
* **$BasePoints$**: The unique points assigned to the matched word in the DB.
* **$CurrentCombo$**: The number of consecutive successes. (Increments by 1 on success; resets to 0 immediately if a word hits the bottom).
* **Display**: The calculated score must be displayed as a real-time cumulative value in the **Score** area of the game screen.

### **C. HP System and Recovery**
* **Deduction**: HP decreases by **10%** whenever a word hits the bottom line.
* **Recovery**: Every time a **20 Combo** is achieved, **5%** of the currently lost HP is restored as a bonus.

## 5. Step 3: UI/UX and Scene Specifications (Design Implementation)

### **A. 3-Scene SPA (Single Page Application) Structure**
* This task must be developed as an **SPA structure** where screens transition without a full page refresh using JavaScript.
* **Scene 1 (Start)**: Player name entry and difficulty selection.
* **Scene 2 (Play)**: The actual game progression screen.
* **Scene 3 (Result)**: Final score summary and Global TOP 5 ranking display.

### **B. Start Scene Requirements**
* **Input Elements**: Game title (CyberTyper 2026), **Player Name input field (Required)**, **Difficulty Selection (Level 1, 2, 3)** via radio buttons or a select box.
* **Start Button**: Becomes active only when all information is entered; clicking it enters the game screen.

### **C. Game Screen Mandatory Components (Marking Items)**
* **Score**: Real-time cumulative scoreboard.
* **Combo**: Current consecutive success count.
* **WPM**: Real-time calculated words per minute.
* **HP Gauge**: A visually changing health bar.
* **Input Field**: Text area for the player to type English words.
* **Falling Words**: Words falling from random top positions.

### **D. Projectile and Fever Effects**
* **Bullet and Collision**: Upon pressing Enter, a bullet is fired from the bottom toward the **real-time coordinates** of the target word. When a collision occurs, a letter-fragment VFX is generated and the word is destroyed.
* **Fever Mode**: Achieving a 20 Combo reduces the fall speed by 50% for 5 seconds and activates a neon background effect.

### **E. Ranking Scene (Result Scene)**
* Displays the **Global TOP 5** leaderboard retrieved from the database.
* **[New Game]** Button: Clicking this resets all settings and returns to the Name Input screen.

---

## 6. Marking Scheme Summary (Total 25.00)

| Category | Detailed Criteria | Marks |
| :--- | :--- | :--- |
| **Design (7.0)** | Dynamic projectile/particle effects, visibility of essential UI (HP, Score), and VFX completion. | 7.0 |
| **Front-end (11.0)** | Difficulty-specific logic (Interval/Speed), duplicate-free word management, and bullet coordinate calculation. | 11.0 |
| **Back-end (7.0)** | **DB table design and data persistence**, Global TOP 5 Ranking API design. | 7.0 |