制作坊飞机大战 专区

飞机大战

cxbd2020-06-13 256人围观
input.onButtonPressed(Button.A, function () {
volume = 0
})
GHBit.onKey(GHBit.enButton.B3, function () {
if (Z_True == 0) {
Z_True = 1
Z = game.createSprite(yahboom.get(LedSpriteProperty.X), 4)
}
})
GHBit.onKey(GHBit.enButton.B1, function () {
start = 1
})
input.onButtonPressed(Button.B, function () {
volume = 1
})
let B: game.LedSprite = null
let A: game.LedSprite = null
let Z: game.LedSprite = null
let Z_True = 0
let volume = 0
let start = 0
let yahboom: game.LedSprite = null
images.createBigImage(`
. . . . . . . . . .
. . . . . . . # . .
. . . . . . # # # .
. . . . . . . # . .
. . . . . . . . . .
`).scrollImage(1, 200)
yahboom = game.createSprite(2, 4)
game.setScore(0)
start = 0
volume = 1
Z_True = 0
let time = 540
basic.forever(function () {
if (start == 1) {
A = game.createSprite(randint(0, 4), 0)
A.turn(Direction.Right, 0)
basic.pause(500)
for (let index = 0; index < 4; index++) {
A.move(1)
basic.pause(500)
}
A.delete()
}
})
basic.forever(function () {
if (GHBit.Rocker(GHBit.enRocker.Left)) {
yahboom.move(-1)
if (volume == 1) {
GHBit.Music_Handle(GHBit.enMusic.jump_up)
}
basic.pause(200)
} else if (GHBit.Rocker(GHBit.enRocker.Right)) {
yahboom.move(1)
if (volume == 1) {
GHBit.Music_Handle(GHBit.enMusic.jump_down)
}
basic.pause(200)
}
})
basic.forever(function () {
if (time >= 1) {
basic.pause(10)
time += -1
} else {
game.pause()
if (volume == 1) {
GHBit.Music_Handle(GHBit.enMusic.punchline)
}
game.gameOver()
start = 0
}
})
basic.forever(function () {
if (start == 1 && Z_True == 1) {
Z.change(LedSpriteProperty.Y, -1)
basic.pause(100)
if (Z.isTouching(A)) {
Z.delete()
Z_True = 0
A.delete()
game.addScore(1)
} else if (Z.isTouching(B)) {
Z.delete()
Z_True = 0
B.delete()
game.addScore(1)
}
if (Z.get(LedSpriteProperty.Y) == 0) {
Z.delete()
Z_True = 0
}
}
})
basic.forever(function () {
if (start == 1) {
basic.pause(500)
B = game.createSprite(randint(0, 4), 0)
B.turn(Direction.Right, 0)
basic.pause(500)
for (let index = 0; index < 4; index++) {
B.move(1)
basic.pause(500)
}
B.delete()
}
})
0 +1

评论