Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 more help on sprites
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
metachief




PostPosted: Mon Feb 04, 2008 10:09 pm   Post subject: 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?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Feb 04, 2008 10:14 pm   Post subject: RE:more help on sprites

boolean not or if - else
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Mackie




PostPosted: Mon Feb 04, 2008 11:55 pm   Post subject: Re: more help on sprites

Here:

Turing:
if not key('a') then


Thats what Tony meant.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: