Initial commit of 001code-html Scratch frontend project.

Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-16 15:37:45 +08:00
commit 6e0a1fbcbb
11350 changed files with 965674 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
const test = require('tap').test;
const Motion = require('../../src/blocks/scratch3_motion');
const Runtime = require('../../src/engine/runtime');
const Sprite = require('../../src/sprites/sprite.js');
const RenderedTarget = require('../../src/sprites/rendered-target.js');
test('getPrimitives', t => {
const rt = new Runtime();
const motion = new Motion(rt);
t.type(motion.getPrimitives(), 'object');
t.end();
});
test('Coordinates have limited precision', t => {
const rt = new Runtime();
const motion = new Motion(rt);
const sprite = new Sprite(null, rt);
const target = new RenderedTarget(sprite, rt);
const util = {target};
motion.goToXY({X: 0.999999999, Y: 0.999999999}, util);
t.equals(motion.getX({}, util), 1);
t.equals(motion.getY({}, util), 1);
t.end();
});