Skip to content

Miu2D is a 2D RPG game engine built with Rust + TypeScript + React + Canvas, designed for the Web platform.

Notifications You must be signed in to change notification settings

luckyyyyy/miu2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

64 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Miu2D Engine

A 2D RPG game engine built with modern Web technologies.

๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡ๆ–‡ๆกฃ

๐Ÿ“– About

Miu2D is a 2D RPG game engine built with TypeScript + React + Canvas, designed for the Web platform.

๐ŸŽฎ Demo: Legend of Yue Ying (ๆœˆๅฝฑไผ ่ฏด) Web Remake

๐ŸŒ Live Demo: https://miu2d.com

As a showcase for the engine, we remade the classic RPG "Moonlight Legend" (ๅ‰‘ไพ ๆƒ…็ผ˜ๅค–ไผ ๏ผšๆœˆๅฝฑไผ ่ฏด) originally released by Kingsoft (่ฅฟๅฑฑๅฑ…) in 2001.

The original game was developed in C++, later remade by fans using C# + XNA framework (JxqyHD). This project ports the game to the Web platform, allowing the classic game to run in browsers.

๐ŸŽจ Vibe Coding Project - This project is developed using pure vibe coding with AI-assisted programming!

๐Ÿ“ฑ Native Mobile Support - Fully adapted for phones and tablets with virtual joystick and touch controls!

๐Ÿ–ฅ๏ธ Desktop

Game Screenshot

๐Ÿ“ฑ Mobile

Mobile Screenshot

๐Ÿ› ๏ธ Built-in Editors

Map Editor - Visual tilemap editing, layer management, collision zones

Map Editor

ASF Editor - Sprite animation frame viewer and debugger

ASF Editor

๐ŸŽฎ Game Features

  • ๐Ÿ—บ๏ธ Wuxia World Exploration - Classic scenes like Lingjue Peak, Wudang Mountain, Hui'an Town
  • โš”๏ธ Real-time Combat - Combination of sword techniques, internal skills, and light skills
  • ๐Ÿง™ Martial Arts - Rich variety of martial arts moves and internal techniques
  • ๐Ÿ’ฌ Story Quests - Follow protagonist Yang Yingfeng on a wuxia adventure
  • ๐ŸŽ’ Equipment System - Collect equipment and items to boost power
  • ๐ŸŽต Original Music - Classic soundtrack and sound effects preserved

โœจ Demo Progress

Overall Completion: ~92%

System Progress Status Main Modules
Map Rendering 95% ๐ŸŸข Ready map.ts, renderer.ts, mapTrapManager.ts
Character System 90% ๐ŸŸข Ready character.ts, player.ts, npc.ts
Sprite Animation 95% ๐ŸŸข Ready sprite.ts, asf.ts
Script System 98% ๐ŸŸข Ready parser.ts, executor.ts, 180+ commands
UI System 95% ๐ŸŸข Ready guiManager.ts, 29 UI components
Audio System 95% ๐ŸŸข Ready audioManager.ts (Web Audio API)
Magic System 90% ๐ŸŸข Ready magicManager.ts, 12 MoveKind effects
Combat System 70% ๐ŸŸก Partial magicHandler.ts
Save System 90% ๐ŸŸข Ready loader.ts, storage.ts
Weather System 85% ๐ŸŸข Ready rain.ts, snow.ts
Mobile Adaptation 95% ๐ŸŸข Ready Virtual joystick, touch controls

Legend: ๐ŸŸข Ready | ๐ŸŸก Partial/In Progress | ๐Ÿ”ด Not Started

Codebase Size

  • Engine Code: ~47,000 lines TypeScript
  • Component Code: ~12,000 lines TSX
  • Script Commands: 180+ command handlers

๐Ÿ—๏ธ Architecture

Tech Stack

  • Language: TypeScript 5.9 (strict mode)
  • Framework: React 19, Vite 7
  • Rendering: HTML5 Canvas 2D
  • Styling: Tailwind CSS 4
  • Audio: Web Audio API (OGG Vorbis)
  • Code Quality: Biome (lint + format)
  • Package Manager: pnpm monorepo

Project Structure

This project uses pnpm monorepo architecture with two independent packages:

Package Directory Description
@miu2d/engine packages/engine/ Pure TypeScript 2D RPG engine, no React dependency
@miu2d/web packages/web/ React application with UI and user interaction

Import engine modules:

// From main entry
import { GameEngine, Direction } from "@miu2d/engine";

// From submodules
import { logger } from "@miu2d/engine/core/logger";
import { resourceLoader } from "@miu2d/engine/resource/resourceLoader";

๐Ÿš€ Quick Start

Requirements

  • Node.js 18+
  • pnpm 9+ (required)
  • Modern browser with Canvas API and Web Audio API support

Installation

# Clone the repository
git clone https://github.com/patchoulib/game-jxqy.git
cd game-jxqy

# Install dependencies
pnpm install

# Start development server
pnpm dev

# Open browser at http://localhost:5173

Commands

pnpm dev        # Start development server
pnpm build      # Build for production
pnpm tsc        # TypeScript type check
pnpm lint       # Code linting
pnpm format     # Code formatting

๐ŸŽฎ Controls

Keyboard

Key Action
Arrow Keys / Click ground Move
Shift + Move Run
Space / Enter Interact / Confirm
Esc Cancel / System menu
1 - 9 Use quick bar skills

๐Ÿ“ฑ Mobile Touch

Action Function
Virtual joystick (bottom-left) Control movement
Tap screen Interact with NPC/Object
Bottom quick bar Use skills
Right side buttons Open menus

๐Ÿ’ป Development

Principles

  1. Follow C# Architecture - Reference /JxqyHD/Engine/ implementation
  2. Access via Engine - All subsystems accessed through GameEngine
  3. Type Safety - Use TypeScript strict mode, avoid any
  4. Event-Driven - Engine and UI communicate via events

For detailed development guide, see .github/copilot-instructions.md


๐Ÿค Contributing

Bug fixes, new features, and documentation improvements are welcome!

  1. Fork this repository
  2. Create a feature branch
  3. Reference the Development Guide
  4. Submit a Pull Request

๐Ÿ“„ License

MIT License - see LICENSE for details.

Note: This is a fan-made learning project. Game assets belong to original creators.


๐Ÿ™ Credits

  • Original Game: Kingsoft (่ฅฟๅฑฑๅฑ…) - Legend of Yue Ying (2001)
  • C# Remake: mapic91/JxqyHD
  • Tech Stack: TypeScript, React 19, Vite 7, Canvas API, Web Audio API

โš”๏ธ Sword spirit spans thirty thousand miles โš”๏ธ

Recreating classic wuxia with modern Web technology

About

Miu2D is a 2D RPG game engine built with Rust + TypeScript + React + Canvas, designed for the Web platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published