27th September 2006, 7:39 PM
(This post was last modified: 27th September 2006, 8:06 PM by Dark Jaguar.)
Explain exactly why it won't work, oh person who apparently knows how to program all of a sudden.
Here's the break down. PC GAMES ALREADY DO THAT. I no longer need to worry about you. Just play any game that lets you assign different functions to a joystick axis! None of them are that detailed but the point is proven. Also, BASIC LOGIC.
Again. You can assign a series of numbers to any position on the axis. This is a fact. Go into the Game Controllers option and you can see the variables yourself.
You can take ANY number that your program has generated or had fed to it and assign any command you want that the language will allow, which is pretty vast. This is also a fact.
So why can't I take a variable and say:
int thingy = joystickposition; //This is beyond dispute. USE YOUR JOYSTICK CALIBRATOR IN WINDOWS. This has already been done.
while gameinprogress = 1
{
If (thingy > 100) then do stuff;
If (thingy == 255) then do this;
If (thingy == 244) then do that;
If (thingy == 244) then do something else; //This is to show that in fact you can assign two things to the same variable using two seperate commands, it'll run this check over and over again.
}
wend
It should be noted that any variable that is displayed by a program (text for example) can also be used by the program in some other way. This is pretty basic stuff here. There's nothing keeping that pseudocode up there from working fine, so long as the API allows for it, and if the API does not, an API can be designed that does.
The only reason I can think of that your teacher would say it's not possible is that you were only being taught to use an existing, but limited, joystick class and weren't really taught the intricacies of that class (it's data was probably hidden from you excepting set and get functionality).
Here's the break down. PC GAMES ALREADY DO THAT. I no longer need to worry about you. Just play any game that lets you assign different functions to a joystick axis! None of them are that detailed but the point is proven. Also, BASIC LOGIC.
Again. You can assign a series of numbers to any position on the axis. This is a fact. Go into the Game Controllers option and you can see the variables yourself.
You can take ANY number that your program has generated or had fed to it and assign any command you want that the language will allow, which is pretty vast. This is also a fact.
So why can't I take a variable and say:
int thingy = joystickposition; //This is beyond dispute. USE YOUR JOYSTICK CALIBRATOR IN WINDOWS. This has already been done.
while gameinprogress = 1
{
If (thingy > 100) then do stuff;
If (thingy == 255) then do this;
If (thingy == 244) then do that;
If (thingy == 244) then do something else; //This is to show that in fact you can assign two things to the same variable using two seperate commands, it'll run this check over and over again.
}
wend
It should be noted that any variable that is displayed by a program (text for example) can also be used by the program in some other way. This is pretty basic stuff here. There's nothing keeping that pseudocode up there from working fine, so long as the API allows for it, and if the API does not, an API can be designed that does.
The only reason I can think of that your teacher would say it's not possible is that you were only being taught to use an existing, but limited, joystick class and weren't really taught the intricacies of that class (it's data was probably hidden from you excepting set and get functionality).
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question." ~ Charles Babbage (1791-1871)