How should i write this? (sloved)

Advanced game related topics
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

How should i write this? (sloved)

Post by Joakim Christiansen »

How should i write this?

Code: Select all

Select KeyboardPushed()
   Case #PB_Key_Up
      ;do something
   Case #PB_Key_Down
      ;do something
   Case #PB_Key_Left
      ;do something
   Case #PB_Key_Right
      ;do something
EndSelect
I mean "KeyboardPushed()" don't work this way, how should i do ths?
Last edited by Joakim Christiansen on Tue Jan 18, 2005 10:01 pm, edited 1 time in total.
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

why not:

Code: Select all

If KeyboardPushed(#PB_Key_Up)
  ; Do something
ElseIf KeyboardPushed(#PB_Key_Down)
  ; Do something
ElseIf KeyboardPushed(#PB_Key_Left)
  ; Do something
endif
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Yeah it works... :)
RedmoonX
User
User
Posts: 26
Joined: Mon Jan 17, 2005 9:54 am
Location: Sweden
Contact:

Post by RedmoonX »

keyboardinkey()

returns what key thats is pressed
^^
-
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

It returns the last typed character.
If I press F then it will return the character F.
If I press Left then it returns nothing, so I can't use this to controll something with the arrow keys.
I like logic, hence I dislike humans but love computers.
RedmoonX
User
User
Posts: 26
Joined: Mon Jan 17, 2005 9:54 am
Location: Sweden
Contact:

Post by RedmoonX »

ohh :o

that was bad :D

RedmoonX ( Slaughter from gmc )
^^
-
Post Reply