Corona Clicker - Level System and New Database
Tags: sql, webdev, gamedev, backend
Published: 2024-06-17 18:03:11

I'm excited to share that the development of Corona Clicker is progressing smoothly. Recently, I made significant advancements by implementing a new database structure and developing a comprehensive level system to enhance the gaming experience. This level system is a completely new feature that didn't exist before.

## New Database Structure
The updated database structure is designed to support the new level system and provide a seamless user experience. Here are the key components:

## Levels Table:
`CREATE TABLE levels (
    id INT PRIMARY KEY AUTO_INCREMENT,
    title VARCHAR(255) NOT NULL,
    points INT NOT NULL,
    svg TEXT NOT NULL
);`

`INSERT INTO levels (title, points, svg) VALUES
('Beginner', 0, '{svg string}'),
('Advanced', 200, '{svg string}'),
('Expert', 300, '{svg string}'),
('Master', 600, '{svg string}'),
('Recognized', 1200, '{svg string}'),
('Elite', 2500, '{svg string}'),
('Leader', 10000, '{svg string}'),
('Guru', 100000, '{svg string}'),
('Mega Guru', 500000, '{svg string}'),
('Legend', 1000000, '{svg string}');`

## Users Table:
`CREATE TABLE users (
    id INT PRIMARY KEY AUTO_INCREMENT,
    tg_id BIGINT NOT NULL,
    score INT DEFAULT 0,
    registration_date DATE NOT NULL
);`

## User Levels Table:
`CREATE TABLE user_levels (
    user_id INT PRIMARY KEY,
    level_id INT NOT NULL,
    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
    FOREIGN KEY (level_id) REFERENCES levels(id) ON DELETE CASCADE
);`

## Level System
The new level system is designed to motivate players by providing clear goals and rewards. Here’s a breakdown of the levels and their respective rewards:
**Level 1: Beginner**

- Requirements: None.
- Reward: None.

**Level 2: Advanced**

- Requirements: Earn 200 points.
- Reward: Access to the /boost page.

**Level 3: Expert**

- Requirements: Earn 300 points.
- Reward: Access to the "Double Time" upgrade on the /boost page.

**Level 4: Master**

- Requirements: Earn 600 points.
- Reward: Access to the "Double Coins" upgrade on the /boost page.

**Level 5: Recognized**

- Requirements: Earn 1200 points.
- Reward: Access to the /shop page and all purchases.

**Level 6: Elite**

- Requirements: Earn 2500 points.
- Reward: None.

**Level 7: Leader**

- Requirements: Earn 10,000 points.
- Reward: None.

**Level 8: Guru**

- Requirements: Earn 100,000 points.
- Reward: None.

**Level 9: Mega Guru**

- Requirements: Earn 500,000 points.
- Reward: None.

**Level 10: Legend**

- Requirements: Earn 1,000,000 or more points.
- Reward: "Legend" status on the /stars page.

## Upgrades
Players can enhance their gameplay with the following upgrades:

**Double Time**
- Description: Increases the time available for clicking the crown by 50%.
- Price: 150 coins.

**Double Coins**
- Description: Increases the number of coins earned per click by 50%.
- Price: 300 coins.

These new features are designed to make Corona Clicker more engaging and rewarding for players.

## Stay Connected
Don't miss out on the latest updates and features of Corona Clicker! Follow the [official Telegram channel](https://t.me/+zYoeSgOD9dU1Mzhi) for all the news and announcements. The new version of Corona Clicker is still under development and is not yet available to all players. Stay tuned for more updates as I continue to improve the game!