setscreen ("graphics:1012;657")
setscreen ("nocursor")
drawfillbox (145, 0, maxx - 145, 145, grey)
drawfillbox (145, maxy - 145, maxx - 145, maxy, grey)
drawfillbox (0, 145, 145, maxy - 145, grey)
drawfillbox (maxx - 145, 145, maxx, maxy - 145, grey)
%top right
drawfillarc (maxx - 145, maxy - 145, 145, 145, 0, 90, grey)
drawfillarc (maxx - 145, maxy - 145, (145 div 2 + 3), (145 div 2 + 3), 0, 90, yellow)
drawfillarc (maxx - 145, maxy - 145, (145 div 2 - 2), (145 div 2 - 2), 0, 90, grey)
%top left
drawfillarc (145, maxy - 145, 145, 145, 90, 180, grey)
drawfillarc (145, maxy - 145, (145 div 2 + 3), (145 div 2 + 3), 90, 180, yellow)
drawfillarc (145, maxy - 145, (145 div 2 - 2), (145 div 2 - 2), 90, 180, grey)
%bottom left
drawfillarc (145, 145, 145, 145, 180, 360, grey)
drawfillarc (145, 145, (145 div 2 + 3), (145 div 2 + 3), 180, 270, yellow)
drawfillarc (145, 145, (145 div 2 - 2), (145 div 2 - 2), 180, 270, grey)
%bottom right
drawfillarc (maxx - 145, 145, 145, 145, 180, 360, grey)
drawfillarc (maxx - 145, 145, (145 div 2 + 3), (145 div 2 + 3), 270, 360, yellow)
drawfillarc (maxx - 145, 145, (145 div 2 - 2), (145 div 2 - 2), 270, 360, grey)
%dotted lines
% for i : 145 .. maxy - 145 by 20
% drawfillbox ((145 div 2) - 2, i, (145 div 2) + 2, i + 10, yellow)
% drawfillbox (maxx - (145 div 2) - 2, i, maxx - (145 div 2) + 2, i + 10, yellow)
% end for
% for i : 145 .. maxx - 145 by 20
% drawfillbox (i, (145 div 2) - 2, i + 10, (145 div 2) + 2, yellow)
% drawfillbox (i, maxy - (145 div 2) - 2, i + 10, maxy - (145 div 2) + 2, yellow)
% end for
process car1
var pic : int := Pic.FileNew ("car1(0).jpg")
var move : string (1)
var move2 : string := ""
var x, y, a : int
x := (maxx div 2) - 155
y := 0
if pic = 0 then
put "Unable to load JPEG: ", Error.LastMsg
return
end if
Pic.Draw (pic, (maxx div 2) - 155, 0, picCopy)
a := 0
loop
drawline (maxx div 2, 0, maxx div 2, 145, white)
getch (move)
if move = "w" then
if a = 0 then
x := x + 10
Pic.Draw (pic, x, y, picCopy)
elsif a = 15 then
x := x + 8
y := y + 2
Pic.Draw (pic, x, y, picCopy)
elsif a = 30 then
x := x + 7
y := y + 4
Pic.Draw (pic, x, y, picCopy)
elsif a = 45 then
x := x + 5
y := y + 5
Pic.Draw (pic, x, y, picCopy)
elsif a = 60 then
x := x + 4
y := y + 7
Pic.Draw (pic, x, y, picCopy)
elsif a = 75 then
x := x + 8
y := y + 2
Pic.Draw (pic, x, y, picCopy)
elsif a = 90 then
y := y + 10
Pic.Draw (pic, x, y, picCopy)
elsif a = 105 then
x := x - 2
y := y + 8
Pic.Draw (pic, x, y, picCopy)
elsif a = 120 then
x := x - 7
y := y + 4
Pic.Draw (pic, x, y, picCopy)
elsif a = 135 then
x := x - 5
y := y + 5
Pic.Draw (pic, x, y, picCopy)
elsif a = 150 then
x := x - 7
y := y + 4
Pic.Draw (pic, x, y, picCopy)
elsif a = 165 then
x := x - 8
y := y + 2
Pic.Draw (pic, x, y, picCopy)
elsif a = 180 then
x := x - 10
Pic.Draw (pic, x, y, picCopy)
elsif a = 195 then
x := x - 8
y := y - 2
Pic.Draw (pic, x, y, picCopy)
elsif a = 210 then
x := x - 7
y := y - 4
Pic.Draw (pic, x, y, picCopy)
elsif a = 225 then
x := x - 5
y := y - 5
Pic.Draw (pic, x, y, picCopy)
elsif a = 240 then
x := x - 4
y := y - 7
Pic.Draw (pic, x, y, picCopy)
elsif a = 255 then
x := x - 2
y := y - 8
Pic.Draw (pic, x, y, picCopy)
elsif a = 270 then
y := y - 10
Pic.Draw (pic, x, y, picCopy)
elsif a = 285 then
x := x + 2
y := y - 8
Pic.Draw (pic, x, y, picCopy)
elsif a = 300 then
x := x + 4
y := y - 7
Pic.Draw (pic, x, y, picCopy)
elsif a = 315 then
x := x + 5
y := y - 5
Pic.Draw (pic, x, y, picCopy)
elsif a = 330 then
x := x + 7
y := y - 4
Pic.Draw (pic, x, y, picCopy)
elsif a = 355 then
x := x + 8
y := y - 2
Pic.Draw (pic, x, y, picCopy)
end if
elsif move = "a" then
if a + 15 = 360 then
a := 0
else
a := a + 15
end if
pic := Pic.Rotate (pic, a, x, y)
Pic.Draw (pic, x, y, picCopy)
elsif move = "d" then
if a - 15 = -15 then
a := 355
else
a := a - 15
end if
pic := Pic.Rotate (pic, a, x, y)
Pic.Draw (pic, x, y, picCopy)
end if
end loop
end car1
fork car1
|