setscreen ("graphics : 800;600")
setscreen ("nocursor")
var chars : array char of boolean
var lvl1_1 : int
lvl1_1 := Pic.FileNew ("Pictures/Level 2/grass.jpg")
Pic.Draw (lvl1_1, 0, 0, picCopy)
Pic.Draw (lvl1_1, 350, 0, picCopy)
Pic.Draw (lvl1_1, 700, 0, picCopy)
var icastillx, icastilly : int
icastillx := 5
icastilly := 93
var icastill : int
icastill := Pic.FileNew ("Pictures/Movements/Icabobstill.jpg")
Pic.Draw (icastill, icastillx, icastilly, picCopy)
Pic.Free (icastill)
var sky : int
sky := Pic.FileNew ("Pictures/Level 2/bluesky.jpg")
Pic.Draw (sky, 0, 180, picCopy)
Pic.Draw (sky, 775, 180, picCopy)
procedure getKey
var ch : string (1)
getch (ch)
end getKey
loop
% Here is where the error is.
if chars (KEY_UP_ARROW) then
icastilly := icastilly + 1
Pic.Draw (icastill, icastillx, icastilly, picCopy)
elsif chars (KEY_DOWN_ARROW) then
icastilly := icastilly - 1
Pic.Draw (icastill, icastillx, icastilly, picCopy)
elsif chars (KEY_LEFT_ARROW) then
icastillx := icastillx - 1
Pic.Draw (icastill, icastillx, icastilly, picCopy)
elsif chars (KEY_RIGHT_ARROW) then
icastillx := icastillx + 1
end if
end loop
|