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

Username:   Password: 
 RegisterRegister   
 I could use some help on scrolling
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ragex




PostPosted: Wed Dec 17, 2003 11:22 pm   Post subject: I could use some help on scrolling

hey ppl, i'm making a pacman game, and i need help on how to get pacman to keep moving even when u stop pressing the left or right or up or down button(scrolling). If you could help me, plz e-mail me bak. thx
Sponsor
Sponsor
Sponsor
sponsor
Thuged_Out_G




PostPosted: Wed Dec 17, 2003 11:33 pm   Post subject: (No subject)

code:

Input.KeyDown (chars)
if chars(key_up_arrow) then
loop
   put "you pressed the up key"
   exit when chars(key_left_arrow) or chars(key_right_arrow) or chars        (key_down_arrow)
end loop
elsif chars(key_down_arrow) then
loop
 put "you pressed the down key"
exit when chars(key_left_arrow) or chars(key_right_arrow) or chars        (key_down_arrow)
end loop
elsif chars(key_left_arrpw) then
loop
put "you pressed the left key"
exit when chars(key_left_arrow) or chars(key_right_arrow) or chars        (key_down_arrow)
end loop
elsif chars(key_right_arrow) then
looop
put "you pressed the right key"
exit when chars(key_left_arrow) or chars(key_right_arrow) or chars        (key_down_arrow)
end loop
end if


try that...the syntax is prolly wrong, but ive never used the Input.KeyDown before, so im not positve...just going by memory[/b][/code]
ragex




PostPosted: Thu Dec 18, 2003 3:11 pm   Post subject: (No subject)

That doesn't work, but thx neway, i figured it out, its:

code:

var (direction) : array char of boolean
     loop
          if direction (KEY_UP_ARROW) then
              loop
                    object_y += 5
                    exit when hasch
              end loop
         if direction (KEY_DOWN_ARROW) then
              loop
                   object_y -= 5
                   exit when hasch
              end loop
%So same thing for left and right.
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: