Skip to content

Commit

Permalink
Initial files for MakeCode project
Browse files Browse the repository at this point in the history
  • Loading branch information
thsparks committed Jun 4, 2024
1 parent 7844f56 commit d72b159
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["ms-edu.pxt-vscode-web"]
}
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: deploy

build:
pxt build

deploy:
pxt deploy

test:
pxt test
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
<script src="https://makecode.com/gh-pages-embed.js"></script><script>makeCodeRender("{{ site.makecode.home_url }}", "{{ site.github.owner_name }}/{{ site.github.repository_name }}");</script>
8 changes: 8 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
makecode:
target: minecraft
platform: minecraft
home_url: https://minecraft.makecode.com/
theme: jekyll-theme-slate
include:
- assets
- README.md
1 change: 1 addition & 0 deletions _history
Original file line number Diff line number Diff line change
@@ -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\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" numargs=\"0\"></mutation><value name=\"command\"><shadow type=\"text\"><field name=\"TEXT\">run</field></shadow></value><statement name=\"HANDLER\"><block type=\"zoo_aquarium\"><value name=\"size\"><shadow type=\"math_number_minmax\"><mutation min=\"6\" max=\"100\" label=\"Size\" precision=\"0\"></mutation><field name=\"SLIDER\">6</field></shadow></value></block></statement></block><"],[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":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><block type=\"minecraftOnChat\" x=\"0\" y=\"0\"><mutation xmlns=\"http://www.w3.org/1999/xhtml\" numargs=\"0\"></mutation><value name=\"command\"><shadow type=\"text\"><field name=\"TEXT\">run</field></shadow></value><statement name=\"HANDLER\"><block type=\"zoo_aquarium\"><value name=\"size\"><shadow type=\"math_number_minmax\"><mutation min=\"6\" max=\"100\" label=\"Size\" precision=\"0\"></mutation><field name=\"SLIDER\">6</field></shadow></value></block></statement></block></xml>","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":[]}
16 changes: 16 additions & 0 deletions custom.ts
Original file line number Diff line number Diff line change
@@ -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));
}

}
1 change: 1 addition & 0 deletions main.blocks
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<xml xmlns="https://developers.google.com/blockly/xml"></xml>
3 changes: 3 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
player.onChat("run", function () {
zoo.aquarium(6)
})
29 changes: 29 additions & 0 deletions pxt.json
Original file line number Diff line number Diff line change
@@ -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"
}
1 change: 1 addition & 0 deletions test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// tests go here; this will not be compiled when this package is used as an extension.
9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "ES5",
"noImplicitAny": true,
"outDir": "built",
"rootDir": "."
},
"exclude": ["pxt_modules/**/*test.ts"]
}

0 comments on commit d72b159

Please sign in to comment.