setscreen ("graphics:800,600")
View.Set ("offscreenonly")
var fishx, fishy, angle, fishpic, fishangle : int := 0
var value, count : int := 1
var ch : string (1)
var chars : array char of boolean
randint (fishx, 1, maxx - 64)
randint (fishy, 1, maxy - 35)
fishpic := Pic.FileNew ("Fish_" + intstr (count) + "_G.bmp")
Pic.Draw (fishpic, fishx, fishy, picMerge)
loop
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
fishpic := Pic.FileNew ("Fish_" + intstr (count) + "_G.bmp")
Pic.Draw (fishpic, fishx, fishy, picMerge)
if count > 0 and count < 10 then
count := count + 1 * value
fishy := fishy + 10
delay (75)
View.Update
cls
elsif count > 9 then
value := -1
count := 8
elsif count < 1 then
value := 1
count := 2
end if
elsif chars (KEY_RIGHT_ARROW) then
fishpic := Pic.FileNew ("Fish_" + intstr (count) + "_G.bmp")
fishangle := Pic.Rotate (fishpic, angle, -1, -1)
Pic.Draw (fishangle, fishx, fishy, picCopy)
Pic.Free (fishpic)
Pic.Free (fishangle)
angle := angle - 10
if count > 0 and count < 10 then
count := count + 1 * value
delay (75)
View.Update
cls
elsif count > 9 then
value := -1
count := 8
elsif count < 1 then
value := 1
count := 2
end if
elsif chars (KEY_LEFT_ARROW) then
fishpic := Pic.FileNew ("Fish_" + intstr (count) + "_G.bmp")
fishangle := Pic.Rotate (fishpic, angle, -1, -1)
Pic.Draw (fishangle, fishx, fishy, picMerge)
angle := angle + 10
if count > 0 and count < 10 then
count := count + 1 * value
delay (75)
View.Update
cls
elsif count > 9 then
value := -1
count := 8
elsif count < 1 then
value := 1
count := 2
end if
end if
end loop
|