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

Username:   Password: 
 RegisterRegister   
 I need help to make my pic move useing the keyboard!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Darkmantis




PostPosted: Tue Oct 18, 2005 3:09 pm   Post subject: I need help to make my pic move useing the keyboard!

I've been useing this code in school and it works but for some reason it doesn't work for me at home. PLz help me!

setscreen ("graphics:400,400")
var x, y, button : int
var kp : string (1)
x := 100
y := 100
procedure drawcar
Pic.ScreenLoad ("car1.bmp", x - 10, y - 10, picMerge)
delay (10)
end drawcar

procedure erasecar
drawfilloval (x, y, 50, 50, white)
end erasecar

kp := "z"
drawcar

loop
if hasch then
getch (kp)
end if


if kp= KEY_RIGHT_ARROW then <--It says that the KEY_RIGHT_ARROW
x := x + 40___________________has not been declared
drawcar
end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
beard0




PostPosted: Tue Oct 18, 2005 4:07 pm   Post subject: (No subject)

Your school has a more recent version of turing than you do. Instead of KEY_RIGHT_ARROW, which only got defined later on, use chr(205), and it will work. You can find this value and others in the help manual, under Turing Language -> Keystroke Codes.
Darkmantis




PostPosted: Tue Oct 18, 2005 8:52 pm   Post subject: (No subject)

ok thanks a lot
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: