keymapper issue

Started by drounal, May 16, 2006, 07:14:56 PM

Previous topic - Next topic

drounal

I used the keymapper function given in the car example to perform several actions during the game. for example, I made it possible to build a cube when pressing key 'c' but each time two cubes are built: it seems like one is added when pressing the key and the other one when releasing the key. How can I change this ?
thx in advance.

Melssj5

Its easy. You use a boolean identifier for each key. then after getting the boolean identifiers asigned you do another methos called doMovements or something like that. so the code have to be like this one.



if (c==state) {
   //draw your cube here
   c=false;    
}



then it will stop drawing cubes after drawing one.
Nada por ahora

drounal

thank u very much for the tip !
++