Magic Pen - Physics Drawing Puzzle Game

Seele01-Flash
By
Magic Pen is an innovative physics-based puzzle game where creativity meets problem-solving. Use your drawing skills to create shapes and contraptions that help guide a red ball to its destination flag through challenging levels.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Magic Pen: Crayon Physics**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: "Crayon on Paper" aesthetic (2.5D). The background should be a textured, slightly crumpled white or blue ruled paper. * **Objects**: * **The Player**: A simple red circle (drawn style) representing the ball. * **The Goal**: A hand-drawn sketch of a flag on a pole. * **Drawn Shapes**: When the user draws, generate meshes that look like rough crayon strokes. Use rough edges or distinct outlines to simulate a hand-drawn look. Colors should be vibrant (green, blue, purple). * **Camera**: Orthographic camera to maintain a flat 2D puzzle perspective, fixed position. * **Mobile Optimization**: Use simple geometry (extruded 2D shapes) with "sketchy" textures rather than high-poly models. Limit the number of active drawn objects to preserve FPS. ### 2. Audio Requirements * **BGM**: A relaxing, acoustic guitar or light piano track that suggests creativity and thinking. * **Sound Effects (SFX)**: * **Drawing**: A scratching/scribbling pencil sound that loops while the user is touching and moving on the screen. * **Collision**: Soft wooden or paper thuds when objects hit the ground or each other. * **Success**: A cheerful "Ta-da!" or bell chime when the ball hits the flag. * **UI**: Paper rustling sounds when switching tools. ### 3. Gameplay Loop * **Core Mechanic**: The red ball is affected by gravity. The player cannot control the ball directly. The player must draw shapes (lines, boxes, ramps) that become physical objects to bridge gaps or push the ball. * **Physics Integration**: Integrate a 2D physics engine (like **Matter.js** or **Cannon.js** locked to 2D axis) to handle gravity, friction, and restitution. Drawn shapes must react to gravity immediately after the finger is lifted unless "pinned." * **Tools**: * **Draw**: Creates rigid bodies. * **Pin (Anchor)**: Fixes a shape to the background (static). * **Hinge**: Connects a shape to the background or another shape with a pivot point (rotational). * **Win Condition**: The red ball collides with the Flag object. * **Reset**: A button to clear all drawn shapes or reset the ball's position if it falls off-screen/gets stuck. ### 4. Mobile Controls & Interaction * **Touch Controls**: * **Drawing**: Single-finger drag on the canvas to draw shapes. The shape creates a physical body upon `touchend`. * **Gestures**: Double-tap on a shape to delete it (Eraser function). * **UI Toolbar (Bottom of Screen)**: * Replace original keyboard controls (A, S, D) with large, touch-friendly icons (minimum 48px height). * **Buttons**: [Pencil Icon (Draw Mode)], [Pin Icon (Anchor Mode)], [Pivot Icon (Hinge Mode)], [Trash Can (Clear All)], [Restart Arrow]. * **Feedback**: * Render a "ghost trail" line while the user is dragging their finger to show the shape being drawn before it solidifies. * Haptic feedback (vibration) when the ball touches the flag. * **Orientation**: Locked to **Landscape Mode** to maximize drawing space. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Magic Pen is a captivating physics-based puzzle game that challenges players to think creatively and solve problems through drawing. With a solid 3.6/5 rating from players worldwide, this innovative game combines artistic expression with logical thinking as you help a red ball reach its target flag in each level.

The game's unique concept revolves around using your mouse as a magical drawing tool to create shapes, platforms, ramps, and mechanical contraptions. Every line you draw becomes a physical object that obeys realistic physics laws, making each solution feel satisfying and rewarding.

Core Features

Creative Problem-Solving Gameplay

Magic Pen stands out by offering unlimited creative solutions to each puzzle. Unlike traditional puzzle games with predetermined solutions, here you can:

  • Draw any shape to create platforms, ramps, or barriers
  • Pin objects to create stable anchor points
  • Build hinged contraptions for moving mechanisms
  • Experiment freely with different approaches to the same problem

Realistic Physics Engine

The game features a sophisticated physics simulation that makes every drawn object behave naturally:

  • Objects fall under gravity and bounce realistically
  • Different shapes affect how objects roll and slide
  • Weight and momentum play crucial roles in solutions
  • Interactive elements respond to collisions and forces

Progressive Difficulty System

Start with simple puzzles and gradually face more complex challenges that require:

  • Multi-step solutions involving several drawn objects
  • Timing-based mechanics where sequence matters
  • Resource management as drawing space becomes limited
  • Creative engineering to build elaborate contraptions

Game Mechanics

Drawing and Creation Tools

Magic Pen provides several essential tools for puzzle-solving:

  • Freeform Drawing : Create any shape imaginable with your mouse
  • Pin Tool : Secure objects to fixed positions for stability
  • Hinge Tool : Create rotating joints for movable mechanisms
  • Eraser : Remove unwanted elements and refine your designs

Physics-Based Interactions

Every element in the game follows realistic physics principles:

  • The red ball responds to gravity, friction, and collisions
  • Drawn shapes have mass and can be pushed or moved by the ball
  • Slopes and angles affect rolling speed and direction
  • Objects can stack, balance, and create chain reactions

Operation Guide

Basic Controls

The game features intuitive controls that anyone can master:

  • Mouse Movement : Draw shapes and lines by clicking and dragging
  • A Key : Switch to eraser tool to remove drawn objects
  • S Key : Activate pin tool to create fixed anchor points
  • D Key : Use hinge tool for rotating mechanical joints
  • Q Key : Access the main menu and level selection

Strategic Tips

  • Start Simple : Begin with basic ramps and platforms before attempting complex machines
  • Observe Physics : Watch how objects interact to understand the game's physics
  • Experiment Freely : There's no penalty for trying different approaches
  • Use Pins Wisely : Anchored objects provide stability for larger constructions
  • Think in Steps : Break complex puzzles into smaller, manageable parts

Why Play Magic Pen

Educational and Entertaining

Magic Pen offers a perfect blend of education and entertainment , making it ideal for players of all ages. The game naturally teaches:

  • Physics concepts through hands-on experimentation
  • Engineering principles via construction challenges
  • Creative thinking by encouraging unique solutions
  • Problem-solving skills through puzzle progression

Accessibility and Convenience

Enjoy Magic Pen with complete freedom:

  • 100% Free : No purchases, subscriptions, or hidden costs
  • No Download Required : Play instantly in any modern web browser
  • Cross-Platform : Works seamlessly on computers, tablets, and smartphones
  • All Ages Content : Safe and appropriate for players of every age
  • Offline Capable : Play without internet once loaded

Endless Replay Value

With multiple solutions possible for each level and the freedom to create your own challenges, Magic Pen offers virtually unlimited gameplay . The creative nature of the puzzles means you can always return to find new and more elegant solutions.

Perfect for Short Sessions

Each level can be completed in just a few minutes, making Magic Pen ideal for:

  • Quick brain training during breaks
  • Creative relaxation after work or study
  • Educational playtime for students
  • Casual gaming sessions anytime, anywhere

Frequently Asked Questions (FAQ)