Microsoft MakeCode

Problem-downloading code to microbit

Hello i am an 11 year old boy who wants to learn to code i have created a code and i have tested it on the micro bit online application window and it works fine. But when i download it on to the microbit nothing happens. The confusing thing is that the micro bit is working because i can put and download other code and games on to it. you can look at my code here.Also i am giving you the code in python because i am not allowed to forward files.

input.onButtonPressed(Button.A, function () {
ship.move(-1)
})
input.onButtonPressed(Button.AB, function () {
shoot = game.createSprite(ship.get(LedSpriteProperty.X), ship.get(LedSpriteProperty.Y))
shoot.change(LedSpriteProperty.Brightness, 80)
for (let index = 0; index < 4; index++) {
shoot.change(LedSpriteProperty.Y, -1)
basic.pause(150)
if (shoot.isTouching(enemy)) {
game.addScore(1)
shoot.delete()
enemy.delete()
}
}
if (shoot.get(LedSpriteProperty.Y) <= 0) {
shoot.delete()
}
})
input.onButtonPressed(Button.B, function () {
ship.move(1)
})
let enemy: game.LedSprite = null
let shoot: game.LedSprite = null
let ship: game.LedSprite = null
ship = game.createSprite(2, 4)
game.setScore(0)
basic.forever(function () {
enemy = game.createSprite(Math.randomRange(1, 3), 0)
enemy.set(LedSpriteProperty.Brightness, 150)
basic.pause(100)
enemy.turn(Direction.Right, 90)
for (let index = 0; index < 4; index++) {
enemy.move(1)
basic.pause(500)
if (enemy.isTouching(ship)) {
game.gameOver()
}
if (enemy.isTouchingEdge()) {
enemy.delete()
}
}
})
Yours sincerely
Yusuf Azar