Music.PlayFile ("c:/Cherub rock.wav")
View.Set ("graphics,offscreenonly,nocurser")
var a, b, c, d, e, f : int
var x, y : int
x := 100
y := 100
var chars : array char of boolean
var ship : int := Pic.FileNew ("c:/game resources/ship.bmp")
var fire : int := Pic.FileNew ("c:/game resources/fire.bmp")
var planet1 : int := Pic.FileNew ("c:/game resources/planet1.bmp")
var planet2 : int := Pic.FileNew ("c:/game resources/planet2.bmp")
colourback (7)
cls
randomize
a := Rand.Int (300, 400)
b := Rand.Int (200, 400)
c := Rand.Int (200, 300)
d := Rand.Int (0, 200)
loop
View.Update
Pic.Draw (planet1, a, b, 0)
View.Update
Pic.Draw (planet2, c, d, 0)
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
y := y + 20
end if
if chars (KEY_DOWN_ARROW) then
y := y - 20
end if
if chars (KEY_LEFT_ARROW) then
x := x - 20
end if
if chars (KEY_RIGHT_ARROW) then
x := x + 20
end if
View.Update
Pic.Draw (ship, x, y, 0)
delay (70)
cls
Input.KeyDown (chars)
if chars (KEY_ENTER) then
var m, n : int
m := x
n := y
View.Update
Pic.Draw (ship, x, y, 0)
for decreasing counter : 8 .. 1
Pic.Draw (ship, x, y, 0)
View.Update
Pic.Draw (fire, m + 100, n + 34, 0)
delay (20)
cls
View.Update
Pic.Draw (fire, m + 100, n - 5, 0)
delay (20)
cls
View.Update
Pic.Draw (ship, x, y, 0)
m := m + 100
View.Update
Pic.Draw (planet1, a, b, 0)
View.Update
Pic.Draw (planet2, c, d, 0)
end for
View.Update
Pic.Draw (planet1, a, b, 0)
View.Update
Pic.Draw (planet2, c, d, 0)
Music.PlayFile ("c:/missile5.wav")
View.Update
Pic.Draw (ship, x, y, 0)
if m = a or c = m and n = b or n = d then
locate (10, 50)
put "you got em..."
Music.PlayFile ("c:/explosion2.wav")
end if
end if
end loop
|