
-----------------------------------
metachief
Mon Feb 04, 2008 10:09 pm

more help on sprites
-----------------------------------
how do i tell turing that is a key is not pressed to esit a loop?
for example in my code:
 

loop

        Input.KeyDown (key)

        if key ('a') then

            loop
                right := false
                left := true

                Pic.Draw (pic1l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic2l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic3l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic4l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic5l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic6l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic7l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic8l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic9l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                Pic.Draw (pic10l, round (x - 70), round (y), picMerge)
                x := x - run_s
                delay (60)
                View.Update
                cls

                end loop
            end if

i want it to exit when the a key is not pressed but i don't know how to make that if statement.
how do i say to turing that is a is not pressed exit the loop?

-----------------------------------
Tony
Mon Feb 04, 2008 10:14 pm

RE:more help on sprites
-----------------------------------
boolean not or if - else

-----------------------------------
Mackie
Mon Feb 04, 2008 11:55 pm

Re: more help on sprites
-----------------------------------
Here:

if not key('a') then

Thats what Tony meant.
