Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with the w,a,s,d commands
#11
Quote:Thanks guys i will give it a try later. Inform you how it turn out.

PS: Can any game be created?? Like a third person shooter??

fps can be done http://forum.qbasicnews.com/viewtopic.php?t=8985
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#12
Quote:Smile Yeah, I can't even get it to work period in widow mode, IDE and the test screen thing... :wink:

But, when you need letter commands, (Moving stuff use arrows, mitth posted that above) but for optional controls that need letters.. use this to prevent it messing up in case cap lock is on, off, or what ever:

(Case insensitive codeSmile
Code:
IF UCASE$(press$) = "W" THEN...
IF UCASE$(press$) = "A" THEN..

Notice that tho, UCASE$(press$) makes the press$ sting all caps whether or not cap lock is on or off, then just check for capital letters...
Example

Player presses key(INKEY$ = "a")
Promt press$(press$ = INKEY$)
Cap press$ (UCASE$(press$))
press$ now = "A"
Check for "A"

Input can also be "A" it will just stay cap, so case insesitive!!!! Big Grin

Can also use LCASE$() which makes selected inputs (in this case press$) lower case.. (e.i. press "A" it chages it to "a" and if press is "a" it stays "a") :wink:

Whenever i do that the arrow keys do not work. You could do

Code:
IF press$ <> (rightarrow.can't remember offtop of my head) and press$ <>  (left arrow) AND press$ <> (up arrow) AND press$ <> (downarrow) THEN press$ = (UCASE$(press$))


i think that will work though there probebly is a quicker and eaisier way to do it (i get things done, but the WAY i do it is VERY no0b)
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#13
Smile No, they want work if you trying to do them both at the same time.. you need a good multy key funtion for apps like that... I really ment that for like RPGs, to stop and pick up items, look at items, ect..
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#14
Rattra:
I think you were misinterpting my post.

I was commenting on how it makes the press sting upper case lol :lol:
i]"But...it was so beautifully done"[/i]
Reply
#15
Quote:Smile No, they want work if you trying to do them both at the same time.. you need a good multy key funtion for apps like that... I really ment that for like RPGs, to stop and pick up items, look at items, ect..

Would my way allow the arrow keys and buttons to be used or not?
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#16
To bad there isn't a onkeydown() event trap like in Javascript. Cause then you could make a function handler that stores it into an array. Then when you check for the keys in your program you could check for all the key that been pressed in your array, then just clear the array. Big Grin
i]"But...it was so beautifully done"[/i]
Reply
#17
FB has a great keyhanderler built in, along with mouse...

Key:

IF MULTIKEY(code for key) THEN....

Mouse:
GETMOUSE x, y, wheel , buttons

SETMOUSE x, y, info 'Locate, & hide or show.. if I'm remember it that bit right..

:wink:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply
#18
Ya well I still magage in QB....don't worry I got nothing against FB, I'm wating till I get SpaceMerc done first.... Big Grin
i]"But...it was so beautifully done"[/i]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)