Computer Science Canada

I could use some help on scrolling

Author:  ragex [ 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

Author:  Thuged_Out_G [ Wed Dec 17, 2003 11:33 pm ]
Post 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]

Author:  ragex [ Thu Dec 18, 2003 3:11 pm ]
Post 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.


: