Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / camre commads using a and d

Author
Message
paint color
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 8th Feb 2009 23:12
im looking to make a camera roll to the left and right by using these commands

if inkey$()="a"
then roll camera left 0,1
endif

but it gives me an error message

can i get some suggestions here?
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 9th Feb 2009 00:08
try using scancode instead of inkey$...
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 9th Feb 2009 00:21
Delete the then in the second line.


Whatever...
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 9th Feb 2009 01:20


This will most certainly work.

But what was causing the error in your code was the then in the second line as Dabbler said. If you want to use then, it must be on the same line as if, along with any lines you want to protect with the conditional.
paint color
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 10th Feb 2009 01:08
thank you, but could you explain the keystate command to me? i dont understand the use of 30
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 10th Feb 2009 01:25
well if you use the scancode() command and print it to the screen whenever you press a key it will come up with a number.

e.g. if pressed a it would return 30 which i could put into keystate(30) and that will watch the keystate and when a is pressed you can do stuff

e.g.
if keystate(30)
`do stuff
Endif
paint color
16
Years of Service
User Offline
Joined: 15th Sep 2008
Location:
Posted: 12th Feb 2009 02:58
is 30 just a random number you picked or is it signifigent in any way?
Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 12th Feb 2009 04:41
Look at my post, four posts up. 30 is the scancode for "a".

Login to post a reply

Server time is: 2024-09-28 02:19:29
Your offset time is: 2024-09-28 02:19:29