setscreen ("graphics: 1010;700, nobuttonbar,nocursor")
View.Set ("offscreenonly")
colorback (blue)
cls
var x, x2, ix, ox, y, y2, w, w2, w3, d, d2, d3, d4, rep, a, a2, side : int
var xh, yh : int
var chars : array char of boolean
x := 300
y := 50
const xh2 := 33
const yh2 := 46
xh := 33
yh := 46
side := 0
ix := 0
ox := 0
d := 5
d2 := 5
d3 := 5
d4 := 5
rep := 0
a := 0
a2 := 0
process move
Input.Pause
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) and side = 0 then
y := y + 1
elsif chars (KEY_UP_ARROW) and side = 1 then
x := x + 1
elsif chars (KEY_UP_ARROW) and side = 3 then
x := x - 1
elsif chars (KEY_UP_ARROW) and side = 2 then
y := y - 1
elsif chars (KEY_RIGHT_ARROW) and side = 0 then
xh := yh2
yh := xh2
side := 1
elsif chars (KEY_RIGHT_ARROW) and side = 1 then
xh := xh2
yh := yh2
side := 2
elsif chars (KEY_RIGHT_ARROW) and side = 2 then
xh := yh2
yh := xh2
side := 3
elsif chars (KEY_RIGHT_ARROW) and side = 3 then
xh := xh2
yh := yh2
side := 0
elsif chars (KEY_LEFT_ARROW) and side = 0 then
xh := yh2
yh := xh2
side := 3
elsif chars (KEY_LEFT_ARROW) and side = 1 then
xh := xh2
yh := yh2
side := 0
elsif chars (KEY_LEFT_ARROW) and side = 2 then
xh := yh2
yh := xh2
side := 1
elsif chars (KEY_LEFT_ARROW) and side = 3 then
xh := xh2
yh := yh2
side :=2
end if
end move
process drawship
randint (w, 3, 5)
if w > 3 then
randint (w2, 3, 6)
randint (w3, 3, 6)
else
randint (w2, 1, 3)
randint (w3, 1, 3)
end if
loop
if rep = 6 then
randint (w, 3, 5)
if w > 3 then
randint (w2, 3, 6)
randint (w3, 3, 6)
else
randint (w2, 1, 3)
randint (w3, 1, 3)
end if
rep := 0
end if
rep := rep + 1
cls
drawline (x - xh, y - yh, x - xh, y + yh, 7)
drawline (x - xh, y - yh, x + xh, y - yh, 7)
drawline (x - xh, y + yh, x + xh, y + yh, 7)
drawline (x + xh, y - yh, x + xh, y + yh, 7)
drawfill (x - (xh - 2), y - (yh - 2), 185, 7)
if side = 0 then
%boaw
drawarc (x + 39, y - 267, 115, 400, 110, 129, 7)
drawarc (x - 41, y - 267, 119, 400, 51, 70, 7)
drawfill (x, y + (yh + 1), 185, 7)
%stiars
for decreasing j : 35 .. 20 by 2
drawline (x - 26, y - 22, x - 26, y - 35, 7)
drawline (x - 32, y - j, x - 26, y - j, 7)
end for
%backmass
drawarc (x, y - 25, 23, w + 1, 0, 180, 7)
drawfillarc (x, y - 26, 23, w, 0, 180, 93)
drawbox (x - 23, y - 33, x + 23, y - 27, 7)
drawfill (x - 22, y - 30, 187, 7)
drawoval (x, y - 30, 6, 6, 7)
drawfilloval (x, y - 30, 5, 5, 187)
%mainmass
drawarc (x, y + 1, 25, w2 + 1, 0, 180, 7)
drawfillarc (x, y + 1, 25, w2, 0, 180, 93)
drawbox (x - 25, y - 7, x + 25, y - 1, 7)
drawline (x - 25, y - 7, x - 25, y - 1, 7)
drawline (x - 25, y - 7, x + 25, y - 7, 7)
drawfill (x - 24, y - 3, 187, 7)
drawoval (x, y - 3, 6, 6, 7)
drawfilloval (x, y - 3, 5, 5, 187)
%Frontmass
drawarc (x, y + 27, 23, w3 + 1, 0, 180, 7)
drawfillarc (x, y + 27, 23, w3, 0, 180, 93)
drawbox (x - 27, y + 19, x + 27, y + 25, 7)
drawfill (x - 26, y + 20, 187, 7)
drawoval (x, y + 22, 6, 6, 7)
drawfilloval (x, y + 22, 5, 5, 187)
elsif side = 1 then
%boaw
drawarc (x - 266, y - 39, 400, 115, 20, 39, 7)
drawarc (x - 267, y + 41, 400, 119, 321, 340, 7)
drawfill (x + (xh + 1), y, 185, 7)
%stiars
for decreasing j : 35 .. 20 by 2
drawline (x - 22, y + 26, x - 35, y + 26, 7)
drawline (x - j, y + 32, x - j, y + 26, 7)
end for
%backmass
drawarc (x - 25, y, w + 1, 23, 270, 90, 7)
drawfillarc (x - 24, y, w, 23, 270, 90, 93)
drawbox (x - 33, y - 23, x - 27, y + 23, 7)
drawfill (x - 32, y - 22, 187, 7)
drawoval (x - 30, y, 6, 6, 7)
drawfilloval (x - 30, y, 5, 5, 187)
%mainmass
drawarc (x + 1, y, w2 + 1, 25, 270, 90, 7)
drawfillarc (x + 1, y, w2, 25, 270, 90, 93)
drawbox (x - 7, y - 25, x - 1, y + 25, 7)
drawfill (x - 6, y - 24, 187, 7)
drawoval (x - 3, y, 6, 6, 7)
drawfilloval (x - 3, y, 5, 5, 187)
%Frontmass
drawarc (x + 27, y, w3 + 1, 23, 270, 90, 7)
drawfillarc (x + 27, y, w3, 23, 270, 90, 93)
drawbox (x + 19, y + 23, x + 25, y - 23, 7)
drawfill (x + 20, y + 22, 187, 7)
drawoval (x + 22, y, 6, 6, 7)
drawfilloval (x + 22, y, 5, 5, 187)
elsif side = 2 then
%boaw
drawarc (x - 39, y + 267, 115, 400, 290, 309, 7)
drawarc (x + 42, y + 267, 119, 400, 231, 250, 7)
drawfill (x, y - (yh + 1), 185, 7)
%stiars
for decreasing j : 35 .. 20 by 2
drawline (x + 26, y + 22, x + 26, y + 35, 7)
drawline (x + 32, y + j, x + 26, y + j, 7)
end for
%backmass
drawarc (x, y + 25, 23, w + 1, 180, 360, 7)
drawfillarc (x, y + 26, 23, w, 180, 360, 93)
drawbox (x + 23, y + 33, x - 23, y + 27, 7)
drawfill (x + 22, y + 30, 187, 7)
drawoval (x, y + 30, 6, 6, 7)
drawfilloval (x, y + 30, 5, 5, 187)
%mainmass
drawarc (x, y - 1, 25, w2 + 1, 180, 360, 7)
drawfillarc (x, y + 1, 25, w2, 180, 360, 93)
drawbox (x + 25, y + 7, x - 25, y + 1, 7)
drawfill (x + 24, y + 3, 187, 7)
drawoval (x, y + 3, 6, 6, 7)
drawfilloval (x, y + 3, 5, 5, 187)
%Frontmass
drawarc (x, y - 27, 23, w3 + 1, 180, 360, 7)
drawfillarc (x, y - 27, 23, w3, 180, 360, 93)
drawbox (x + 27, y - 19, x - 27, y - 25, 7)
drawfill (x + 26, y - 20, 187, 7)
drawoval (x, y - 22, 6, 6, 7)
drawfilloval (x, y - 22, 5, 5, 187)
elsif side = 3 then
%boaw
drawarc (x + 266, y - 39, 400, 115, 141, 160, 7)
drawarc (x + 267, y + 41, 400, 119, 200, 219, 7)
drawfill (x - (xh + 1), y, 185, 7)
%stiars
for decreasing j : 35 .. 20 by 2
drawline (x + 22, y - 26, x + 35, y - 26, 7)
drawline (x + j, y - 32, x + j, y - 26, 7)
end for
%backmass
drawarc (x + 25, y, w + 1, 23, 90, 270, 7)
drawfillarc (x + 24, y, w, 23, 90, 270, 93)
drawbox (x + 33, y + 23, x + 27, y - 23, 7)
drawfill (x + 32, y + 22, 187, 7)
drawoval (x + 30, y, 6, 6, 7)
drawfilloval (x + 30, y, 5, 5, 187)
%mainmass
drawarc (x - 1, y, w2 + 1, 25, 90, 270, 7)
drawfillarc (x - 1, y, w2, 25, 90, 270, 93)
drawbox (x + 7, y + 25, x + 1, y - 25, 7)
drawfill (x + 6, y + 24, 187, 7)
drawoval (x + 3, y, 6, 6, 7)
drawfilloval (x + 3, y, 5, 5, 187)
%Frontmass
drawarc (x - 27, y, w3 + 1, 23, 90, 270, 7)
drawfillarc (x - 27, y, w3, 23, 90, 270, 93)
drawbox (x - 19, y - 23, x - 25, y + 23, 7)
drawfill (x - 20, y - 22, 187, 7)
drawoval (x - 22, y, 6, 6, 7)
drawfilloval (x - 22, y, 5, 5, 187)
end if
fork move
View.Update
delay (20)
end loop
end drawship
fork drawship
|