Git Product home page Git Product logo

scratch-blocks's Introduction

scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.

CircleCI

An image of Scratch Blocks running on a tablet

Introduction

Scratch Blocks is a fork of Google's Blockly project that provides a design specification and codebase for building creative computing interfaces. Together with the Scratch Virtual Machine (VM) this codebase allows for the rapid design and development of visual programming interfaces. Unlike Blockly, Scratch Blocks does not use code generators, but rather leverages the Scratch Virtual Machine to create highly dynamic, interactive programming environments.

This project is in active development and should be considered a "developer preview" at this time.

Two Types of Blocks

A divided image showing horizontal blocks on the left and vertical blocks on the right

Scratch Blocks brings together two different programming "grammars" that the Scratch Team has designed and continued to refine over the past decade. The standard Scratch grammar uses blocks that snap together vertically, much like LEGO bricks. For our ScratchJr software, intended for younger children, we developed blocks that are labelled with icons rather than words, and snap together horizontally rather than vertically. We have found that the horizontal grammar is not only friendlier for beginning programmers but also better suited for devices with small screens.

Documentation

The "getting started" guide including FAQ and design documentation can be found in the wiki.

Donate

We provide Scratch free of charge, and want to keep it that way! Please consider making a donation to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!

Committing

This project uses semantic release to ensure version bumps follow semver so that projects depending on it don't break unexpectedly.

In order to automatically determine version updates, semantic release expects commit messages to follow the conventional-changelog specification.

You can use the commitizen CLI to make commits formatted in this way:

npm install -g commitizen@latest cz-conventional-changelog@latest

Now you're ready to make commits using git cz.

scratch-blocks's People

Contributors

anmatanm avatar carlosperate avatar chrisgarrity avatar corydcode avatar cwillisf avatar daarond avatar dependabot-preview[bot] avatar drigz avatar edauterman avatar ericrosenbaum avatar espertus avatar fsih avatar kchadha avatar marisaleung avatar neilfraser avatar nikerabbit avatar paulkaplan avatar picklesrus avatar quachtina96 avatar rachel-fenichel avatar renovate-bot avatar renovate[bot] avatar rschamp avatar seanlip avatar semantic-release-bot avatar siebrand avatar thebrokenrail avatar thisandagain avatar tmickel avatar towerofnix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scratch-blocks's Issues

Documentation - Update demos

We are unfortunately going to end up breaking quite a few of the demos. Prior to making this repo public we should make sure to audit / update / remove items from the ./demos directory.

Sounds - Update sound effects

Update sound effects with assets from Scratch / Scratch Jr. Now would be a good time to audit these with the design team:

  • click
  • delete
  • disconnect
  • change category

@carljbowman any thoughts?

Design - Zoom controls

In Scratch on web / desktop we have zoom controls in the bottom right of the editor:
image

For tablet and desktop / web, we should make a decision as to what we want:

  • No controls (no zooming)
  • Button controls
  • Pinch to zoom controls

One consideration is that "pinch to zoom" will impact the potential for multitouch interaction with blocks.

/cc @tmickel

Design - Pan Controls

In blockly the mouse scroll wheel defaults to controlling zoom level. This feels pretty confusing IMO on Mac OS and we've discussed mapping our pan / zoom behavior to be closer to what is used in Apple Maps. Related to #43

Design - Fields / Selectors

To Do

  • Define list of supported "fields"
  • Initial design pass for each field
    • Horizontal
      • String
      • Number
      • Drop-down (events)
    • Vertical
      • String
      • Number
      • Drop-down
      • Angle
      • Musical note (Keyboard)
      • Color
      • Variable
  • Design review
  • Second design pass
  • Handoff for implementation

Questions

  • Device / platform specific fields?

Related to #2 #3

Kickoff Meeting

  • Set dates (1/25 โ€“ 1/29)
  • Collaboratively set agenda with Google Team
  • Book a room at the Media Lab
    • Monday: 244
    • Tuesday - Friday: LLK meeting room

Toolbox - Support Scratch Jr style

  • Allow Toolbox to be placed at different locations.
  • Allow Toolbox to support horizontal layout of blocks and labels.
  • Make sure Toolbox labels can support icons.
    • Allow icons instead of text labels.
    • Ensure alt text for icons works.
    • Support selection UI for icons.

Design - Block insertion UI

We currently have two different ways to "insert" a block that is inconsistent between Scratch and Scratch Jr. From observation (particularly on mobile devices), we'd like to implement a variant of our design from Scratch Jr for all grammars.

Scratch Jr

img_0005

Scratch

screen-shot-2016-01-19-at-10 37 59-am

Scratch (Prototype)

screen-shot-2016-01-19-at-10 41 00-am

Blockly

screen-shot-2016-01-19-at-10 51 12-am

Tickle

img_0006


Questions

  • In Scratch Jr and some of our prototypes even if you are inserting a group (stack) of blocks, the UI only shows an insertion shadow for the top / outer most block. This is different from some other Scratch variants in which the entire group is shown. This is done to avoid jarring changes in the display (see Tickle for reference) but comes at the cost of slightly inconsistent behavior. This is something we should discuss / spec.

Design - Vertical Grammar

  • Define subset of blocks for initial design pass
  • Initial design pass
    • Input Block (Integer)
    • Hat Block
    • Input Block (String)
    • Dropdown Block
    • C-Block (Repeat)
    • Variable Block
    • Dropdown/Input Block (Integer)
    • Boolean Block
  • Design review
  • Second design pass
  • Handoff for implementation

Design - Reconcile behaviour when dragging out of the workspace

Blockly currently:

  • Deletes the block if it's dragged out of the side with the toolbox, no matter how far past the toolbox the drag ends.
  • Otherwise drops the block at the point in the workspace nearest the pointer's final position, no matter where the pointer exited the workspace.

Scratch currently:

  • Deletes the block if it's dragged into the "flyout" section of the toolbox.
  • Adds the blocks to the other sprite and returns them to their original position, if the drag ends on top of a sprite.
  • Otherwise returns them to their original position, including if they were dropped on the category section of the toolbox.

Design - Toolbox

We need to design the overall GUI for our initial prototypes with special emphasis on the palette (toolbox) / workspace paradigm. Discussion with the team has suggested that we should quickly explore and prototype a range of options. This is due to the fact that no one solution really seems to be perfect just yet.

Benchmarks / Reference

  • Scratch
  • Scratch Jr
  • Blockly
  • Blockly Games
  • Tickle
  • OzoBlockly
  • Dash & Dot

API - Support hex values for block "colour"

Blocks currently only accept a hue rotation value. We'd like to modify this to allow either a hue rotation value (number) or hex color value (string).

Example

{
  "id": "math_foo",
  "message0": "foo bar",
  "args0": [],
  "colour": 120,
  "tooltip": "",
  "helpUrl": "http://www.example.com/"
}
{
  "id": "math_foo",
  "message0": "foo bar",
  "args0": [],
  "colour": "#C98323",
  "tooltip": "",
  "helpUrl": "http://www.example.com/"
}

Reasoning

  • The HSV and HSL color models are really handy, but are unrelated to human perception. Because of this, having the flexibility to make small adjustments in order to make the color system look unified and aesthetically pleasing is important.
  • Looking at a few other implementations (Dash and Dot, Sphero, App Inventor) it looks like modifying blockly to allow the specification of absolute color values is pretty widespead.
  • Scratch's block colors are fairly well established and understood by the existing userbase.

/cc @afmckinney

Generators - Remove dart, php, and python generators

As we port over the Scratch grammar we should decide which generators we want to support. My initial thought is we'd want to support a generator for Javascript and a generator for SB2(3) but drop support for some other languages which the community can help us fill-in over time.

This is likely a topic for our kickoff coming up soon, but feel free to drop any initial thoughts in here:
/cc @cwillisf @rschamp @mewtaylor @NeilFraser @rachel-fenichel

Documentation โ€“ proposal for documentation of svg methods

I was thinking that it might be helpful, since the methods for handling svg drawing are visual, to adopt a coding convention that contextualizes the methods visually in addition to docstrings. These comments could show an example of what the method draws, as well as reference constants/variables used throughout the method spatially/visually for debugging purposes. Here's an example of what I'm kind of thinking of roughly:

/**
 * Render the left edge of the block.
 * @param {!Array.<string>} steps Path of block outline.
 * @param {!Object} connectionsXY Location of block.
 * @param {number} rightEdge Minimum width of block.
 * @private
 *
 *                 __
 * start point -> /
 *                |
 *                 \
 *                  \
 *                   |  <-- Blockly.BlockSvg.NOTCH_HEIGHT
 *                   |
 *                  /
 *                 / 
 *                |
 * end point   -> \__
 */
Blockly.BlockSvg.prototype.renderDrawLeft_ =
    function(steps, connectionsXY, bottom) {
.
.
.
};

Thoughts?

Design - Horizontal Grammar

To Do

  • Define subset of blocks for initial design pass
  • Initial design pass
    • Flag
    • Event receipt
    • Event emitter
    • Move right [int]
    • Reset
    • Say [string]
    • Repeat [int]
    • Forever
  • Design review
  • Second design pass
  • Handoff for implementation

Questions

  • Should the "forever" block continue to be an end-cap? No (see below)
  • Should we have a template for a block w/o an icon (text-based)?
  • How do we handle use-cases like the "Mic" block in Scratch Jr?

Set up regular rebase process

Since this depends on work in progress in Blockly a merge from upstream Blockly should be done on a regular basis to avoid large painful merges in the future. A standard merge can be used as this project will never be merged back in to upstream.

https://help.github.com/articles/syncing-a-fork/

Let's set up a schedule for this and can investigate automation if needed.

Reconcile connection behaviour between Scratch and Blockly

Blockly:

  • Dragging blocks can pick up blocks whose outputs are near the moving block's inputs.
  • Dragging blocks can be dragged into other blocks (moving block's output connects to stationary block's input)

Scratch:

  • Dragging blocks can be dragged into other blocks (moving block's output connects to stationary block's input)
  • Dragging blocks will not pick up blocks whose outputs are near the moving block's inputs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.