var playwindow : int := Window.Open ("graphics:500;500,nobuttonbar,position:top,left,offscreenonly")
colorback (black)
var minimap : int := Window.Open ("graphics:200;200,nobuttonbar,position:top,right,offscreenonly,title:Minimap")
colorback (2)
var key : array char of boolean
var startx, starty : int := 100
var x, y : int := 250
var minix, miniy : int := x
procedure refresh
Window.Select (playwindow)
colorback (black)
cls
if key (KEY_LEFT_ARROW) then
startx += 5
elsif key (KEY_RIGHT_ARROW) then
startx -= 5
elsif key (KEY_UP_ARROW) then
starty -= 5
elsif key (KEY_DOWN_ARROW) then
starty += 5
end if
drawline (startx, 0, startx, maxy, white)
drawline (0, starty, maxx, starty, white)
drawfilloval (startx, starty, 5, 5, white)
drawfilloval (x, y, 10, 10, 12)
color (white)
locate (1, 1)
put "X - Difference: ", startx - x ..
locate (2, 1)
put "Y - Difference: ", starty - y ..
View.Update
Window.Select (minimap)
cls
colorback (2)
drawline (maxx div 2, 0, maxx div 2, maxy, white)
drawline (0, maxy div 2, maxx, maxy div 2, white)
drawfilloval (maxx div 2, maxy div 2, 2, 2, white)
minix := round (100 - ((startx - x) / 20))
miniy := round (100 - ((starty - y) / 20))
drawfilloval (minix, miniy, 2, 2, 12)
View.Update
end refresh
loop
Input.KeyDown (key)
refresh
delay (10)
end loop
|