View Single Post
Old 08-15-2007, 04:05 PM   #23
ns66
Connoisseur
ns66 doesn't litterns66 doesn't litter
 
Posts: 78
Karma: 156
Join Date: Jul 2007
Device: sony reader
Quote:
Originally Posted by diabloNL View Post
Tried that and it didn't work.




I'm using that a lot. So by using for example this in main.xml:

Code:
<function id="doLeft">
{Some code}
</function>
With that you can use your own code that starts when the joystick left is pressed. The PROBLEM here is that I haven't figured out how to call the original function. For example:


Code:
<function id="doLeft">
if (a == 1) {
this.doRight();
}
else {
this.doLeft();
}
</function>
This won't work because it will call it's own function that it's in. Creating a loop. So it's not possible to do the original joystick left function when a !=1 We need to find out how to listen to the keys itself rather then the function they do.
just a thought, create a new method with a different name like doLeft2, in there you call this.doLeft(), so you avoid the recursive loop, and map the key to call doLeft2
ns66 is offline   Reply With Quote