Introduction: Micro:bit Basketball Arcade Game (DMP)
Digital Maker's SG very own Basketball Arcade Game!
Step 1: Materials
Step 2: Dimension for Wood Planks
Step 3: Cutting of Wood Pieces
Step 4: Assembling Wood Pieces
Step 5: Completed Cut Wood Pieces
Step 6: Making Bottom Surface of Court
Step 7: Place Bottom Surface Into Frame
Step 8: Assembling the Hoop (Pt.1)
Step 9: Assembling the Hoop (Pt.2)
Step 10: Assembling the Hoop (Pt.3)
Step 11: Assembling the Hoop (Pt.4)
Step 12: Assembling the Hoop (Pt.5)
Step 13: Pathway for Basketball
Step 14: IR Sensor Placement
Step 15: Completed Basketball Frame
Step 16: Coding of the Micro:bit (Pt.1)
Step 17: Coding of the Micro:bit (Pt.2)
Step 18: Download Code to Micro:bit
Step 19: Time to Play!
Step 20: THE END!

Participated in the
Microcontroller Contest 2017
3 Comments
6 weeks ago
let time = 0
let time2 = 0
let IR_Digi = 0
let high_score = 0
input.onButtonPressed(Button.A, function () {
music.startMelody(music.builtInMelody(Melodies.PowerUp), MelodyOptions.Once)
score = 0
time = input.runningTime()
time2 = 0
while (time2 < time + 20000) {
IR_Digi = pins.digitalReadPin(DigitalPin.P1)
if (IR_Digi == 1) {
score = score + 1
basic.showNumber(score)
pins.digitalWritePin(DigitalPin.P1, 0)
}
time2 = input.runningTime()
}
music.startMelody(music.builtInMelody(Melodies.PowerDown), MelodyOptions.Once)
basic.showString("GAME OVER SCORE")
basic.showNumber(score)
basic.showString("NEW HIGH SCORE")
if (score >= high_score) {
high_score = score
music.startMelody(music.builtInMelody(Melodies.Entertainer), MelodyOptions.Once)
}
score = 0
time = 0
time2 = 0
IR_Digi = 0
})
input.onButtonPressed(Button.B, function () {
basic.showString("HIGH SCORE")
basic.showNumber(high_score)
})
Question 1 year ago on Step 18
Hi, I couldn't make the sensor work. I copy your programming but the microbit only counts to 14 and stops, then shows game over and I do not know what am I doing wrong.
Greeting
Question 4 years ago
Hello there, I have followed all of the instructions EXACTLY and the coding part A doesn't seem to be working. After the time is up instead of showing the score if shows the time. I am not sure why.