Hide DAL.x behind Enum

This commit is contained in:
Amerlander
2020-02-20 17:00:11 +01:00
parent 004b1d9662
commit 07fe2645cf
56 changed files with 101 additions and 101 deletions

View File

@ -7,7 +7,7 @@ let level: number
let swapSpeed: number
initializeGame()
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
if (ballRevealing) {
index = index + 1
if (index > 2) {
@ -16,7 +16,7 @@ input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
basic.showString(cupSelect[index], 150)
}
})
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
if (ballRevealing) {
ballRevealing = false
if (correctBall == index) {

View File

@ -18,7 +18,7 @@ counter = 0
pause = 700
led.plot(oneX, oneY)
led.plot(twoX, twoY)
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
if (oneX > 0) {
led.unplot(oneX, oneY)
led.unplot(twoX, twoY)
@ -28,7 +28,7 @@ input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
led.plot(twoX, twoY)
}
})
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
if (twoX < 4) {
led.unplot(oneX, oneY)
led.unplot(twoX, twoY)

View File

@ -107,12 +107,12 @@ basic.forever(() => {
basic.pause(500)
}
})
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
let temp = Math.abs(person.dirX) * (-1)
person.dirX = Math.abs(person.dirY) * (-1)
person.dirY = temp
})
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
let temp1 = Math.abs(person.dirX)
person.dirX = Math.abs(person.dirY)
person.dirY = temp1

View File

@ -24,13 +24,13 @@ playOneGame(gameTime)
showFinalScores(scoreA, scoreB)
function startIOMonitor() {
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
AWasPressed = true
})
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
BWasPressed = true
})
input.input.onButtonEvent(Button.AB, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.AB, ButtonEvent.Click, () => {
ABWasPressed = true
AWasPressed = false
BWasPressed = false

View File

@ -501,13 +501,13 @@ function convertPenaltyTimeToScore(penaltyTime: number): number {
}
function startIOMonitor() {
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
AWasPressed = true
})
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
BWasPressed = true
})
input.input.onButtonEvent(Button.AB, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.AB, ButtonEvent.Click, () => {
ABWasPressed = true
})
input.onShake(() => {

View File

@ -377,11 +377,11 @@ function beepNTimesFor(times: number, duration: number) {
function startIOMonitor() {
aWasPressed = false
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
aWasPressed = true
})
bWasPressed = false
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
bWasPressed = true
})
wasTweezers = false

View File

@ -476,10 +476,10 @@ function testTiltZ() {
}
function startIOMonitor() {
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
AWasPressed = true
})
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
input.input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
BWasPressed = true
})
input.onShake(() => {