var x, y : int := 100
 
var sorax, soray : int :=200
 
var rikux, rikuy : int :=500 
 
var charpress: array char of boolean
 
 
View.Set ("offscreenonly")
 
 
var Rup1 : int := Pic.FileNew ("R-up1.jpg")
 
var Rup2 : int := Pic.FileNew ("R-up2.jpg")
 
var Rup3 : int := Pic.FileNew ("R-up3.jpg")
 
var Rup4 : int := Pic.FileNew ("R-up4.jpg")
 
var Rup5 : int := Pic.FileNew ("R-up5.jpg")
 
var Rup6 : int := Pic.FileNew ("R-up6.jpg")
 
var Rup7 : int := Pic.FileNew ("R-up7.jpg")
 
var Rup8 : int := Pic.FileNew ("R-up8.jpg")
 
 
 
procedure movesora (var sorax : int, var soray : int)
 
    Input.KeyDown (charpress)
 
    if charpress (KEY_UP_ARROW) then
 
        soray := soray + 2
 
    end if
 
    if charpress (KEY_RIGHT_ARROW) then
 
        sorax := sorax + 2
 
    end if
 
    if charpress (KEY_LEFT_ARROW) then
 
        sorax := sorax - 2
 
    end if
 
    if charpress (KEY_DOWN_ARROW) then
 
        soray := soray - 2
 
        end if
 
        if charpress ('l') then
 
        sorax:=500
 
        soray:=300
 
        end if
 
    end movesora
 
    
 
procedure moveriku (var rikux :int, var rikuy :int)    
 
if charpress ('w') then
 
rikuy:=rikuy+2
 
end if
 
if charpress ('s') then
 
rikuy:=rikuy-2
 
end if
 
if charpress ('a') then
 
rikux:=rikux-2
 
end if
 
if charpress ('d') then
 
rikux:=rikux+2
 
end if
 
if charpress ('e') then
 
rikux:=200
 
rikuy:=200
 
end if
 
end moveriku
 
 
View.Set ("offscreenonly")
 
loop
 
    cls
 
    Draw.FillBox (0,0, maxx, 10, green)
 
    Draw.FillBox (0,10, 10,maxy, green)
 
    Draw.FillBox (0,10,0,maxy,green)
 
    movesora (sorax, soray)
 
    moveriku(rikux, rikuy)
 
    Pic.Draw (Rup1,sorax, soray, picMerge)
 
    Pic.Draw (Rup2, rikux, rikuy, picMerge)
 
    View.Update
 
end loop
 
  |