Author Topic: keymapper issue  (Read 3261 times)

Offline drounal

  • byte
  • *
  • Posts: 16
    • View Profile
keymapper issue
« on: May 16, 2006, 07:14:56 pm »
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.

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
keymapper issue
« Reply #1 on: May 16, 2006, 07:52:00 pm »
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.

Code: [Select]


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



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

Offline drounal

  • byte
  • *
  • Posts: 16
    • View Profile
keymapper issue
« Reply #2 on: May 16, 2006, 08:55:04 pm »
thank u very much for the tip !
++