Skip to content

Commit

Permalink
Lily/HackedBlocks: various tweaks (#969)
Browse files Browse the repository at this point in the history
  • Loading branch information
pumpkinhasapatch authored Aug 28, 2023
1 parent da211fe commit ca2a9dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions extensions/Lily/HackedBlocks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Name: Hacked Block Collection
// Name: Hidden Block Collection
// ID: lmsHackedBlocks
// Description: Various modified vanilla blocks.
// Description: Various "hacked blocks" that work in Scratch but are not visible in the palette.
// By: LilyMakesThings <https://scratch.mit.edu/users/LilyMakesThings/>
// By: pumpkinhasapatch

(function (Scratch) {
"use strict";
Expand All @@ -10,11 +11,13 @@
getInfo() {
return {
id: "lmsHackedBlocks",
name: "Hacked Block Collection",
name: "Hidden Blocks",
docsURI: "https://en.scratch-wiki.info/wiki/Hidden_Blocks#Events",
blocks: [
// Use the sensing_touchingobjectmenu instead of event_ to also list sprites, since the block supports it
{
blockType: Scratch.BlockType.XML,
xml: '<block type="event_whentouchingobject"><value name="TOUCHINGOBJECTMENU"><shadow type="event_touchingobjectmenu"/></value></block>',
xml: '<block type="event_whentouchingobject"><value name="TOUCHINGOBJECTMENU"><shadow type="sensing_touchingobjectmenu"/></value></block>',
},
"---",
{
Expand All @@ -26,38 +29,34 @@
xml: '<block id="while" type="control_while"/>',
},
"---",
// Counting blocks that function similarly to variables
{
blockType: Scratch.BlockType.XML,
xml: '<block type="sensing_keypressed"><value name="KEY_OPTION"><shadow type="text"><field name="TEXT">enter</field></shadow></value></block>',
},
{
blockType: Scratch.BlockType.XML,
xml: '<block type="sensing_touchingobject"><value name="TOUCHINGOBJECTMENU"><shadow type="text"><field name="TEXT">Stage</field></shadow></value></block>',
},
{
blockType: Scratch.BlockType.XML,
xml: '<block type="sensing_touchingcolor"><value name="COLOR"><shadow type="text"><field name="TEXT">#ffffff</field></shadow></value></block>',
xml: '<block type="control_get_counter"/>',
},
{
blockType: Scratch.BlockType.XML,
xml: '<block type="sensing_coloristouchingcolor"><value name="COLOR"><shadow type="text"><field name="TEXT">#ffffff</field></shadow></value><value name="COLOR2"><shadow type="text"><field name="TEXT">#ffffff</field></shadow></value></block>',
xml: '<block type="control_incr_counter"/>',
},
{
blockType: Scratch.BlockType.XML,
xml: '<block type="operator_join"><value name="STRING1"><shadow type="colour_picker"/></value><value name="STRING2"><shadow type="text"><field name="TEXT"></field></shadow></value></block>',
xml: '<block type="control_clear_counter"/>',
},
"---",
{
blockType: Scratch.BlockType.XML,
xml: '<block type="control_get_counter"/>',
xml: '<block type="operator_round"><value name="NUM"><shadow type="note"><field name="NOTE">60</field></shadow></value></block>',
},
"---",
{
blockType: Scratch.BlockType.XML,
xml: '<block type="control_incr_counter"/>',
xml: '<block type="operator_join"><value name="STRING1"><shadow type="colour_picker"/></value><value name="STRING2"><shadow type="text"><field name="TEXT"></field></shadow></value></block>',
},
// Dot matrix input from the micro:bit extension
// Returns a 5x5 binary grid of pixels depending on what was drawn. White pixels are 1 and green pixels are 0
{
blockType: Scratch.BlockType.XML,
xml: '<block type="control_clear_counter"/>',
xml: '<block type="operator_join"><value name="STRING1"><shadow type="matrix"><field name="MATRIX">1111110101001000010001110</field></shadow></value><value name="STRING2"><shadow type="text"><field name="TEXT"></field></shadow></value></block>',
},
],
};
Expand Down
Binary file added images/Lily/HackedBlocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca2a9dc

Please sign in to comment.