From d72b1592bca5e18362b35e770a5861c8ecdb1596 Mon Sep 17 00:00:00 2001 From: Thomas Sparks <69657545+thsparks@users.noreply.github.com> Date: Mon, 3 Jun 2024 19:36:13 -0700 Subject: [PATCH] Initial files for MakeCode project --- .vscode/extensions.json | 3 +++ .vscode/settings.json | 29 +++++++++++++++++++++++++++++ Gemfile | 2 ++ Makefile | 10 ++++++++++ README.md | 24 ++++++++++++++++++++++++ _config.yml | 8 ++++++++ _history | 1 + custom.ts | 16 ++++++++++++++++ main.blocks | 1 + main.ts | 3 +++ pxt.json | 29 +++++++++++++++++++++++++++++ test.ts | 1 + tsconfig.json | 9 +++++++++ 13 files changed, 136 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 Gemfile create mode 100644 Makefile create mode 100644 README.md create mode 100644 _config.yml create mode 100644 _history create mode 100644 custom.ts create mode 100644 main.blocks create mode 100644 main.ts create mode 100644 pxt.json create mode 100644 test.ts create mode 100644 tsconfig.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..65a6eec --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["ms-edu.pxt-vscode-web"] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d865f58 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,29 @@ +{ + "editor.formatOnType": true, + "files.autoSave": "afterDelay", + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/built/**": true, + "**/node_modules/**": true, + "**/yotta_modules/**": true, + "**/yotta_targets": true, + "**/pxt_modules/**": true, + "**/.pxt/**": true + }, + "files.associations": { + "*.blocks": "html", + "*.jres": "json" + }, + "search.exclude": { + "**/built": true, + "**/node_modules": true, + "**/yotta_modules": true, + "**/yotta_targets": true, + "**/pxt_modules": true, + "**/.pxt": true + }, + "files.exclude": { + "**/pxt_modules": true, + "**/.pxt": true + } +} \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..91ceacd --- /dev/null +++ b/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'github-pages', group: :jekyll_plugins \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9068464 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +all: deploy + +build: + pxt build + +deploy: + pxt deploy + +test: + pxt test diff --git a/README.md b/README.md new file mode 100644 index 0000000..ca4e802 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ + +> Open this page at [https://thsparks.github.io/aquarium-test/](https://thsparks.github.io/aquarium-test/) + +## Use as Extension + +This repository can be added as an **extension** in MakeCode. + +* open [https://minecraft.makecode.com/](https://minecraft.makecode.com/) +* click on **New Project** +* click on **Extensions** under the gearwheel menu +* search for **https://github.com/thsparks/aquarium-test** and import + +## Edit this project + +To edit this repository in MakeCode. + +* open [https://minecraft.makecode.com/](https://minecraft.makecode.com/) +* click on **Import** then click on **Import URL** +* paste **https://github.com/thsparks/aquarium-test** and click import + +#### Metadata (used for search, rendering) + +* for PXT/minecraft + diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..9760d87 --- /dev/null +++ b/_config.yml @@ -0,0 +1,8 @@ +makecode: + target: minecraft + platform: minecraft + home_url: https://minecraft.makecode.com/ +theme: jekyll-theme-slate +include: + - assets + - README.md diff --git a/_history b/_history new file mode 100644 index 0000000..eb43073 --- /dev/null +++ b/_history @@ -0,0 +1 @@ +{"entries":[{"timestamp":1717468545613,"editorVersion":"1.7.28","changes":[{"type":"edited","filename":"custom.ts","patch":[{"diffs":[[-1,"-"],[0,"/**\n * C"]],"start1":0,"start2":0,"length1":9,"length2":8}]}]},{"timestamp":1717468568873,"editorVersion":"1.7.28","changes":[{"type":"edited","filename":"main.blocks","patch":[{"diffs":[[0,"y/xml\"><"],[1,"block type=\"minecraftOnChat\" x=\"0\" y=\"0\">run6<"],[0,"/xml>"]],"start1":48,"start2":48,"length1":13,"length2":461}]},{"type":"edited","filename":"pxt.json","patch":[{"diffs":[[0," ],\n"],[-1," \"testFiles\": [\n \"test.ts\"\n ],\n"],[0," "]],"start1":223,"start2":223,"length1":52,"length2":8}]},{"type":"added","filename":"test.ts","value":"// tests go here; this will not be compiled when this package is used as an extension.\n"}]}],"snapshots":[{"timestamp":1717468545612,"editorVersion":"1.7.28","text":{"main.blocks":"run6","main.ts":"player.onChat(\"run\", function () {\n zoo.aquarium(6)\n})\n","README.md":"","custom.ts":"/**\n * Custom blocks\n */\n//% color=#FA1234 icon=\"\"\nnamespace zoo {\n \n //% block=\"build glow squid tank of size $size\"\n //% size.defl=6\n //% size.min=6 size.max=100\n export function aquarium(size: number) {\n blocks.fill(GLASS, pos(0, 0, 0), pos(size, size, size), FillOperation.Replace);\n blocks.fill(WATER, pos(1, 1, 1), pos(size-1, size-1, size-1), FillOperation.Replace);\n mobs.spawn(GLOW_SQUID, pos(size/2, size/2, size/2));\n }\n\n}\n","pxt.json":"{\n \"name\": \"Aquarium\",\n \"description\": \"\",\n \"dependencies\": {\n \"core\": \"*\",\n \"builder\": \"*\"\n },\n \"files\": [\n \"main.blocks\",\n \"main.ts\",\n \"README.md\",\n \"custom.ts\"\n ],\n \"targetVersions\": {\n \"branch\": \"v1.7.28\",\n \"tag\": \"v1.7.28\",\n \"commits\": \"https://github.com/microsoft/pxt-minecraft/commits/43da08b76c2f6625ff14c4dd6110a975e16396e8\",\n \"target\": \"1.7.28\",\n \"pxt\": \"9.2.8\"\n },\n \"preferredEditor\": \"tsprj\"\n}\n"}}],"shares":[]} \ No newline at end of file diff --git a/custom.ts b/custom.ts new file mode 100644 index 0000000..59dc48c --- /dev/null +++ b/custom.ts @@ -0,0 +1,16 @@ +-/** + * Custom blocks + */ +//% color=#FA1234 icon="" +namespace zoo { + + //% block="build glow squid tank of size $size" + //% size.defl=6 + //% size.min=6 size.max=100 + export function aquarium(size: number) { + blocks.fill(GLASS, pos(0, 0, 0), pos(size, size, size), FillOperation.Replace); + blocks.fill(WATER, pos(1, 1, 1), pos(size-1, size-1, size-1), FillOperation.Replace); + mobs.spawn(GLOW_SQUID, pos(size/2, size/2, size/2)); + } + +} diff --git a/main.blocks b/main.blocks new file mode 100644 index 0000000..cd87c89 --- /dev/null +++ b/main.blocks @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/main.ts b/main.ts new file mode 100644 index 0000000..c6f43c2 --- /dev/null +++ b/main.ts @@ -0,0 +1,3 @@ +player.onChat("run", function () { + zoo.aquarium(6) +}) diff --git a/pxt.json b/pxt.json new file mode 100644 index 0000000..37f59de --- /dev/null +++ b/pxt.json @@ -0,0 +1,29 @@ +{ + "name": "Aquarium", + "description": "", + "dependencies": { + "core": "*", + "builder": "*" + }, + "files": [ + "main.blocks", + "main.ts", + "README.md", + "custom.ts" + ], + "testFiles": [ + "test.ts" + ], + "targetVersions": { + "branch": "v1.7.28", + "tag": "v1.7.28", + "commits": "https://github.com/microsoft/pxt-minecraft/commits/43da08b76c2f6625ff14c4dd6110a975e16396e8", + "target": "1.7.28", + "pxt": "9.2.8", + "targetId": "minecraft" + }, + "supportedTargets": [ + "minecraft" + ], + "preferredEditor": "tsprj" +} diff --git a/test.ts b/test.ts new file mode 100644 index 0000000..7bf240c --- /dev/null +++ b/test.ts @@ -0,0 +1 @@ +// tests go here; this will not be compiled when this package is used as an extension. diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..46f831b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "target": "ES5", + "noImplicitAny": true, + "outDir": "built", + "rootDir": "." + }, + "exclude": ["pxt_modules/**/*test.ts"] +}