Skip to content

Commit

Permalink
Designed the basic blocks in the extension
Browse files Browse the repository at this point in the history
  • Loading branch information
juliekol committed Feb 10, 2024
1 parent 55f0d1e commit e14d963
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
Binary file added .github/makecode/blocks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions levels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//% color=#20bf6b weight=100 icon="\uf0ae"
namespace levels {

/**
Change the current level that is playing
**/
//% block
//% l.defl=1
export function startLevel(l: number = 1) {
}

/**
Restart the current level
**/
//% block
export function restartLevel() {
}

/**
Start the next level (increment level by one)
**/
//% block
export function startNextLevel() {
}

/**
Set the code to run on the start of each level
@param l the level number
**/
//% block="on start level $l"
//% l.defl=1
export function onStartLevel(l: number = 1, handler: () => void): void {
}
}
2 changes: 1 addition & 1 deletion main.blocks
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<xml xmlns="https://developers.google.com/blockly/xml"><variables><variable id="N?FY*G*IS#wMe%RQ)SQr">value</variable><variable id="ZF;V,?GK~M=;bIAH$8CJ">list</variable></variables><block type="pxt-on-start" id="8nuM@-?-?%%;/r/|yHC?" x="0" y="0"></block></xml>
<xml xmlns="https://developers.google.com/blockly/xml"><block type="pxt-on-start" id="@!{Ymfd?WLn82.Z50V$L" x="0" y="0"></block></xml>
5 changes: 3 additions & 2 deletions pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"main.blocks",
"main.ts",
"README.md",
"assets.json"
"assets.json",
"levels.ts"
],
"testFiles": [
"test.ts"
Expand All @@ -20,5 +21,5 @@
"supportedTargets": [
"arcade"
],
"preferredEditor": "blocksprj"
"preferredEditor": "tsprj"
}

0 comments on commit e14d963

Please sign in to comment.