
-----------------------------------
Hemin
Mon Jun 09, 2008 8:00 am

Joystick Progam HElP!
-----------------------------------
i need help making a joystick program but i do not know how to incorporate it into my maze game here is the code for the game:
procedure Maze
    drawfillbox (100, 35, 120, 160, black)
    drawfillbox (50, 35, 100, 52, black)
    drawfillbox (110, 35, 192, 52, black)
    drawfillbox (0, 110, 35, 129, black)
    drawfillbox (0, 0, 25, 52, black)
    drawfillbox (200, 13, 180, 140, black)
    drawfillbox (0, 0, 120, 19, black)
    drawfillbox (55, 120, 80, 140, black)
    drawfillbox (0, 593, 190, 285, black)
    drawfillbox (81, 137, 179, 121, black)
    % Middle
    drawfillbox (250, 150, 230, 282, black)
    drawfillbox (145, 180, 200, 162, black)
    drawfillbox (140, 95, 180, 110, black)
    drawfillbox (350, 100, 220, 120, black)
    drawfillbox (0, 200, 65, 180, black)
    drawfillbox (525, 35, 310, 51, black)
    drawfillbox (340, 78, 69, 62, black)
    drawfillbox (350,168,328,121,black)


    %Top Right Corner of maze
    drawfillbox (593, 190, 234, 212, black)
    drawfillbox (245, 239, 103, 223, black)
    drawfillbox (619,297,638,300,black)
    % Top left corner of maze
    drawfillbox (385, 250, 0, 269, black)
    drawfillbox (594,300,618,153,black)
    drawfillbox (618,152,413,128,black)
    %Bottom Right Corner of maze
    drawfillbox (524,51,548,0,black)
    drawfillbox (508,127,493,73,black)
    drawfillbox (463,48,448,108,black)
    drawfillbox (428,128,413,62,black)
    drawfillbox (413,113,368,101,black)
    drawfillbox (596,127,578,18,black)
    drawfillbox (548,50,533,108,black)
    

    %Colored boxes/Traps these are good and bad
    drawfillbox (230, 150, 201, 121, green)
    drawfillbox (80, 20, 101, 35, blue)
    %Winning Area
    drawfillbox (0, 249, 65, 200, 14)
   
end Maze
Maze

%Moving Dot/Preventing dot from going through walls prevent outside clipping region
var x, y : int
var move : string (1)
var answer : string
x := 630
y := 290

loop

    drawfilloval (x, y, 2, 2, 4)
    getch (move)
    if move = chr (200) and y < 298 then
        drawfilloval (x, y, 2, 2, 0)
        y := y + 5
        if whatdotcolor (x, y) = (black) then
            y := y - 5
        end if
    elsif move = chr (203) and x > 2 then
        drawfilloval (x, y, 2, 2, 0)
        x := x - 5
        if whatdotcolor (x, y) = (black) then
            x := x + 5

        end if
    elsif move = chr (205) and x < 638 then
        drawfilloval (x, y, 2, 2, 0)
        x := x + 5
        if whatdotcolor (x, y) = (black) then
            x := x - 5

        end if
    elsif move = chr (208) and y > 3 then
        drawfilloval (x, y, 2, 2, 0)
        y := y - 5
        if whatdotcolor (x, y) = (black) then
            y := y + 5

        end if
    end if


    %Color Trap # 1
    if whatdotcolor (x, y) = (green) then
        y := 293
        x := 630
    end if


    %Color Trap # 2
    if whatdotcolor (x, y) = (blue) then
        y := 140
        x := 155
    end if



    %Invisible Trap asks a skill testing question for the player to win
    if x >= 68 and x = 190 and y 