
-----------------------------------
Rasta Fella
Thu Jan 19, 2006 7:09 pm

How To Constantly Check Values?!      Help=20 Bits
-----------------------------------
AHHH...Due Tommorow and I was Procrastinating the whole time.
Ok, I made a dot so that when you press any arrow key and let go it will go in that direction forever untill another direction is pressed. Now the problem is I want to now constantly check the x,y cordinates while it moving across the page. Right now the problem is that it only checks the x,y values when you press that key...but I want it to check even if you are not pressing that key. The reason I need this is because I need whatdotcolour to "read" these values. Please help below is my source. I can't change much because we had to hand in psedocode to my teacher already.

Below is Code:
proc movedot                                                                                        
    Input.KeyDown (chars) 
        if chars (KEY_UP_ARROW) then 
            if y = 337 then 
                        boom_death_reset 
                        movedot 
                    elsif whatdotcolour(x,y)=red then 
                        boom_death_reset 
                    elsif whatdotcolour(x,y)=yellow then 
                        exit 
                    end if 
                end loop 
            end if 
        end if 
        if chars (KEY_RIGHT_ARROW) then 
            if x = 547 then 
                        boom_death_reset 
                    end if 
                end loop 
            end if 
        end if 
        if chars (KEY_LEFT_ARROW) then 
            if x >= 13 then 
                loop 
                    x := x - 1 
                    drawfilloval (x, y, 1, 1, white) 
                    delay (5) 
                    drawfilloval (x, y, 1, 1, black) 
                    Input.KeyDown (chars) 
                    exit when chars (KEY_DOWN_ARROW) or chars (KEY_UP_ARROW) or chars (KEY_RIGHT_ARROW) 
                    if x = 53 then 
                loop 
                    y := y - 1 
                    drawfilloval (x, y, 1, 1, white) 
                    delay (5) 
                    drawfilloval (x, y, 1, 1, black) 
                    Input.KeyDown (chars) 
                    exit when chars (KEY_LEFT_ARROW) or chars (KEY_UP_ARROW) or chars (KEY_RIGHT_ARROW) 
                    if y