adding a few more blocks

This commit is contained in:
Peli de Halleux
2017-10-24 05:30:05 -07:00
parent 8fa6cf41ca
commit fe46461c4c
5 changed files with 71 additions and 28 deletions

View File

@ -1,8 +1,8 @@
screen.clear()
screen.drawText("PXT!", 10, 30, Draw.Quad)
screen.print("PXT!", 10, 30, Draw.Quad)
screen.drawRect(40, 40, 20, 10, Draw.Fill)
output.setLights(LightsPattern.Orange)
output.setStatusLight(LightsPattern.Orange)
screen.drawIcon(100, 50, screen.doubleIcon(screen.heart), Draw.Double | Draw.Transparent)
@ -12,37 +12,37 @@ input.buttonEnter.onEvent(ButtonEvent.Click, () => {
input.buttonLeft.onEvent(ButtonEvent.Click, () => {
screen.drawRect(10, 70, 20, 10, Draw.Fill)
output.setLights(LightsPattern.Red)
output.setStatusLight(LightsPattern.Red)
screen.setFont(screen.microbitFont())
})
input.buttonRight.onEvent(ButtonEvent.Click, () => {
screen.drawText("Right!", 10, 60)
screen.print("Right!", 10, 60)
})
input.buttonDown.onEvent(ButtonEvent.Click, () => {
screen.drawText("Down! ", 10, 60)
screen.print("Down! ", 10, 60)
})
input.buttonUp.onEvent(ButtonEvent.Click, () => {
screen.drawText("Up! ", 10, 60)
screen.print("Up! ", 10, 60)
})
let num = 0
input.touchSensor.onEvent(ButtonEvent.Click, () => {
screen.drawText("Click! " + num, 10, 60)
screen.print("Click! " + num, 10, 60)
num++
})
input.remoteTopLeft.onEvent(ButtonEvent.Click, () => {
screen.drawText("TOPLEFT " + num, 10, 60)
screen.print("TOPLEFT " + num, 10, 60)
num++
})
input.remoteTopRight.onEvent(ButtonEvent.Down, () => {
screen.drawText("TOPRIGH " + num, 10, 60)
screen.print("TOPRIGH " + num, 10, 60)
num++
})
@ -54,7 +54,7 @@ loops.forever(() => {
/*
loops.forever(() => {
let v = input.color.getColor()
screen.drawText(10, 60, v + " ")
screen.print(10, 60, v + " ")
loops.pause(200)
})
*/