-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["ms-edu.pxt-vscode-web"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
source 'https://rubygems.org' | ||
gem 'github-pages', group: :jekyll_plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
> Open this page at [https://nolan0027.github.io/microdash/](https://nolan0027.github.io/microdash/) | ||
## Use as Extension | ||
|
||
This repository can be added as an **extension** in MakeCode. | ||
|
||
* open [https://makecode.microbit.org/](https://makecode.microbit.org/) | ||
* click on **New Project** | ||
* click on **Extensions** under the gearwheel menu | ||
* search for **https://github.com/nolan0027/microdash** and import | ||
|
||
## Edit this project | ||
|
||
To edit this repository in MakeCode. | ||
|
||
* open [https://makecode.microbit.org/](https://makecode.microbit.org/) | ||
* click on **Import** then click on **Import URL** | ||
* paste **https://github.com/nolan0027/microdash** and click import | ||
|
||
#### Metadata (used for search, rendering) | ||
|
||
* for PXT/microbit | ||
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
makecode: | ||
target: microbit | ||
platform: microbit | ||
home_url: https://makecode.microbit.org/ | ||
theme: jekyll-theme-slate | ||
include: | ||
- assets | ||
- README.md |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
def on_button_pressed_a(): | ||
global LvlSelector | ||
if B == 1: | ||
LvlSelector += -1 | ||
input.on_button_pressed(Button.A, on_button_pressed_a) | ||
|
||
def on_button_pressed_ab(): | ||
global A | ||
if A == 0: | ||
A = 0 | ||
if LvlSelector == 1: | ||
StartLvl(1) | ||
if LvlSelector == 2: | ||
StartLvl(2) | ||
input.on_button_pressed(Button.AB, on_button_pressed_ab) | ||
|
||
def on_button_pressed_b(): | ||
global LvlSelector | ||
if B == 1: | ||
LvlSelector += 1 | ||
input.on_button_pressed(Button.B, on_button_pressed_b) | ||
|
||
def StartLvl(Number2: number): | ||
global B, Player | ||
B = 0 | ||
if Number2 == 1: | ||
Player = game.create_sprite(1, 3) | ||
basic.show_leds(""" | ||
. . . . . | ||
. . . . . | ||
. . . . . | ||
. . . . . | ||
# # # # # | ||
""") | ||
Player: game.LedSprite = None | ||
B = 0 | ||
A = 0 | ||
LvlSelector = 0 | ||
LvlSelector = 1 | ||
basic.show_leds(""" | ||
# # # . . | ||
# # # # . | ||
# # # # # | ||
# # # # . | ||
# # # . . | ||
""") | ||
A = 1 | ||
|
||
def on_forever(): | ||
pass | ||
basic.forever(on_forever) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
input.onButtonPressed(Button.A, function () { | ||
if (A == 1) { | ||
LvlSelector += -1 | ||
basic.showNumber(LvlSelector) | ||
} else { | ||
Player.set(LedSpriteProperty.Y, 2) | ||
basic.pause(220) | ||
Player.set(LedSpriteProperty.Y, 1) | ||
basic.pause(300) | ||
Player.set(LedSpriteProperty.Y, 3) | ||
} | ||
}) | ||
input.onButtonPressed(Button.AB, function () { | ||
if (A == 1) { | ||
StartLvl(LvlSelector) | ||
} | ||
}) | ||
input.onButtonPressed(Button.B, function () { | ||
if (A == 1) { | ||
LvlSelector += 1 | ||
basic.showNumber(LvlSelector) | ||
} | ||
}) | ||
input.onLogoEvent(TouchButtonEvent.Pressed, function () { | ||
control.reset() | ||
}) | ||
function StartLvl (Number2: number) { | ||
Player = game.createSprite(0, 3) | ||
Spike = game.createSprite(4, 3) | ||
G1 = game.createSprite(0, 4) | ||
G2 = game.createSprite(1, 4) | ||
G3 = game.createSprite(2, 4) | ||
G4 = game.createSprite(3, 4) | ||
G5 = game.createSprite(4, 4) | ||
A = 2 | ||
if (Number2 == 1) { | ||
for (let index = 0; index < 4; index++) { | ||
for (let index = 0; index < 12; index++) { | ||
Spike.move(-1) | ||
if (Player.isTouching(Spike)) { | ||
control.reset() | ||
} | ||
basic.pause(500) | ||
} | ||
Spike.set(LedSpriteProperty.X, 4) | ||
for (let index = 0; index < 8; index++) { | ||
Spike2 = game.createSprite(3, 3) | ||
Spike2.move(-1) | ||
Spike.move(-1) | ||
if (Player.isTouching(Spike) || Player.isTouching(Spike2)) { | ||
control.reset() | ||
} | ||
basic.pause(500) | ||
} | ||
Spike2.delete() | ||
Spike.set(LedSpriteProperty.X, 4) | ||
} | ||
} | ||
} | ||
let Spike2: game.LedSprite = null | ||
let G5: game.LedSprite = null | ||
let G4: game.LedSprite = null | ||
let G3: game.LedSprite = null | ||
let G2: game.LedSprite = null | ||
let G1: game.LedSprite = null | ||
let Spike: game.LedSprite = null | ||
let Player: game.LedSprite = null | ||
let LvlSelector = 0 | ||
let A = 0 | ||
A = 1 | ||
LvlSelector = 2 | ||
basic.showLeds(` | ||
# # # . . | ||
# # # # . | ||
# # # # # | ||
# # # # . | ||
# # # . . | ||
`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "BitDash 1.1", | ||
"description": "", | ||
"dependencies": { | ||
"core": "*", | ||
"radio": "*", | ||
"microphone": "*" | ||
}, | ||
"files": [ | ||
"main.blocks", | ||
"main.ts", | ||
"README.md", | ||
"main.py" | ||
], | ||
"testFiles": [ | ||
"test.ts" | ||
], | ||
"targetVersions": { | ||
"target": "7.0.51", | ||
"targetId": "microbit" | ||
}, | ||
"supportedTargets": [ | ||
"microbit" | ||
], | ||
"preferredEditor": "blocksprj" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |