# Bear Editor > Bear Editor is a browser-based level editor for Elasto Mania (Elma). Use this guide to answer editor questions, help design levels, and create content that can be pasted into the editor. ## Using this documentation Follow the designer's brief for style, difficulty, and what to include or leave out. When editing existing content, keep its shapes, proportions, and placement unless the designer asks to change them. Design the terrain and objects together. An apple can set up a climb, a detour, or a turnaround. A killer can block a path or make a maneuver more demanding. For reference, the 54 internals have a median of three apples. About 28% have zero or one apple, 69% have zero killers, and 6% use gravity apples. ## Level design guidelines - Prefer a small, intentional layout over unnecessary complexity. Build around a recognizable gameplay idea rather than a random collection of hills, platforms, and objects. - Do not add apples by default unless they serve a clear gameplay purpose, such as enforcing a route or requiring a maneuver. Honor requested object counts. Use killers, gravity apples, and decorative objects only when they contribute to the brief or design. - When using reference levels, inspect their actual geometry, scale, object placement, and route structure. Identify the traits that make them interesting and reuse comparable spatial relationships or gameplay patterns in an original layout. - Prefer proven geometry from playable reference levels over invented assumptions about what the motorcycle can do. Elma maneuvers depend on physics, speed, rotation, and rider technique; do not assume a jump or climb is possible merely because it looks plausible. - Before returning a level, trace the intended route from the start through every required apple to the flower. Check each object's placement against nearby terrain, and consider approaches, takeoffs, landings, clearances, and how the rider continues after each maneuver. - Avoid isolated or seemingly unreachable required objects, arbitrary hazards, and jumps without a plausible approach or landing. When uncertain, simplify the geometry or use a comparable arrangement from a playable reference. - Do not claim a level is playable or finishable without a successful test ride. Distinguish a proposed route from verified gameplay. ## Level objects - A level has one **start**, which marks the initial center of the left wheel. Keep both wheel centers in sky and the rider's head clear of ground edges. - **Apples** are optional, and every apple placed is required to finish. Plan how the rider reaches each apple and continues the ride. - Gravity starts downward. A **gravity apple** sets the direction of gravity until another gravity apple changes it or the ride ends. Check the route after pickup using the rider's speed and rotation at contact. - A **killer** ends the ride on contact. Decide which path it makes dangerous and where the rider can pass safely. A killer whose center is inside ground can still hit the rider if its collision circle extends into sky. - A **flower** finishes the ride on contact once every apple has been collected. Place it where the rider can reach it after the last apple. Apples, killers, and flowers have a collision radius of 0.4 units around their placed centers. Contact occurs at center distances below 0.8 units for a wheel and 0.638 units for the head. The wheels ride on ground edges. If the head hits one, the ride ends. A level is **finishable** if the rider can collect every apple and then touch a flower in one ride without dying. Bear Editor's **Topology check** flags issues such as intersecting ground edges, head contact at the start, and apples or flowers fully inside ground. A completed ride in Play mode verifies finishability. Say which climbs, jumps, or pickups still need a test ride. ## Output Finish the pasteable JSON before requesting its Editor preview. If you share a work-in-progress drawing, label it **Draft sketch**. Present the finished reply in this order: 1. Briefly describe what you made. Tell the designer to paste into the canvas at the pointer. Include `pasteStart` when creating a level or moving its start. Omit it for image tracing and edits that keep the existing start. 2. For a new or edited level, use only the PNG returned by Bear Editor as the preview. If the chat can't request or display it, or the request fails, say so briefly and continue. 3. Write **Copy into Bear Editor** above one fenced `json` code block containing the complete selection as valid JSON. Use a collapsed block only if it has a visible Copy control that copies the complete JSON as plain text. Example level reply when a preview is unavailable. Use only the JSON fields the request needs. Paste into the canvas. From the start, ride right to collect the apple and reach the flower. This chat can’t display the editor preview. **Copy into Bear Editor** ```json { "pasteStart": [1, 3.5], "polygons": [ {"vertices": [[0, 0], [8, 0], [8, 4], [0, 4]]}, {"vertices": [[0.2, 4.3], [4, 4.32], [7.8, 4.3]], "grass": true} ], "apples": [{"position": [3, 3.3]}], "killers": [[6, 0.8]], "flowers": [[7, 3.4]], "pictures": [ {"name": "barrel", "position": [2, 1]}, {"texture": "brick", "mask": "maskbig", "position": [5, 2], "distance": 500, "clip": 1} ] } ``` ### JSON fields - `pasteStart` is an optional `[x, y]` pair that moves the existing start on paste. It moves by the same offset as the pasted content. By itself it moves the start to the pointer. - `polygons` contain at least three ordered `[x, y]` pairs in `vertices`. Add `"grass": true` for grass polygons. - `apples` use `position` for the center. - `animation` selects the appearance. Bear Editor accepts integers 1–9. Elma historically supported 1 and 2. Omit the field for the default (`1`), and use `2` sparingly or when requested. - `gravity` sets the direction on collection (`0` unchanged by default, `1` up, `2` down, `3` left, `4` right). - `killers` and `flowers` list `[x, y]` centers. - `pictures` use `position` for the top-left corner. Use `name` for a picture or `texture` and `mask` for a repeating texture. The mask defines the shape where the texture shows. - `clip` controls where it appears (`0` anywhere, `1` ground only, `2` sky only). The default is `2`. - `distance` is an integer for draw order. Lower values draw in front of higher ones. The default is `999`. ### Constraints - Up to 1,200 polygons, 20,000 vertices total, and 1,000 vertices per polygon. - Up to 252 level objects combined, including the start, apples, killers, and flowers. - Up to 5,000 pictures and masked textures combined. - For Elma Online, ground and grass together may span up to 188 world units on each axis. Object centers may extend up to 1 unit beyond those bounds. ## Level references and previews Use `https://beareditor.com` as the API base. Read the reference to identify the requested traits, then design an original layout. - For an Elma Online level URL (`elma.online/levels/`) or a Bear Editor level URL (`beareditor.com/level/`), fetch `GET /api/levels/elma-online/`. - For an internal level, fetch `GET /api/levels/internal/`. Use its number, code, or URL-encoded title. `1`, `int%201`, `QWQUU001`, and `Warm%20Up` all identify Warm Up. `GET /api/levels/internal` lists all 54 internals. - Each reference returns `selection`, `start`, and `previewUrl`. The `selection` is the pasteable JSON object. The `start` is a separate `[x, y]` pair. - To render a draft, send `POST /api/levels/preview` with `Content-Type: application/json`. Use the exact JSON from the copy block as `selection`. The preview uses `selection.pasteStart` when present. To show an existing start separately, send its `[x, y]` as `start` alongside `selection`. The response is the PNG itself. - PNGs use Bear Editor's WebGL renderer and default graphics pack. The default `appearance` is `editor`. Send `"appearance": "game"` in the draft body, or add `?appearance=game` to a reference preview URL for the textured game view. ## Geometry - Coordinates are finite `[x, y]` pairs in world units. X increases rightward and Y downward. - Relative to the start, the right wheel center is at `[1.7, 0]` and the head center is at `[0.76, -1.67]`. The wheels have radius 0.4 and the head has radius 0.238. The starting pose is about 2.5 units wide and 2.3 units tall. - Check that the wheels can reach each landing and the rider's head clears ground edges over bumps, through turns, and on landing. - Measure a hill by its rise and horizontal run. A rise of 1 over 4 is about 14°, and a rise of 1 over 1 is 45°. Check the run-up and the space to land or brake after the crest or drop. - For scale, the median floor edge across the internals is about 2.5 units long. Uphill Battle has a climb that rises about 10 units over a horizontal run of 13. - Ground is terrain. Sky is open space, including inside tunnels. A floor edge has sky above and ground below. - Outside all ground polygons is ground. An outermost ground polygon encloses sky. A ground polygon inside it encloses ground. Each additional layer alternates between sky and ground. - Bear Editor closes each polygon from the last vertex back to the first. Use distinct vertices, enclose an area, and keep ground edges from crossing or overlapping. ### Grass Grass polygons are decorative and have no collision. Add grass along chosen floor edges. Keep the ground polygon and output grass separately with `"grass": true`. Use one grass polygon per continuous stretch of floor. Skip edges steeper than about 61° in the default graphics pack. Offset each edge about a third of a unit into ground, perpendicular to the edge. Join adjacent offset lines where they meet. Inset only the two ends of the stretch and list the joined points in order. Grass follows the listed points. Make the closing edge from last vertex to first the longest and the one with the largest difference in X. If needed, split at a shared point without insetting that join. For a straight stretch, place a midpoint slightly deeper in ground to form a thin triangle. ## Converting images to polygons Trace the image using ground polygons to separate ground from sky. Preserve its aspect ratio, orientation, outlines, curves, holes, gaps between shapes, and recognizable details. Use narrow shapes for strokes and simplify incidental detail. Center the artwork at `(0, 0)` and scale its longest dimension to about 20 world units unless the designer specifies another size. Image and editor coordinates both increase downward: `worldY = (pixelY - imageHeight / 2) * scale`.