Sensor Logic Brick: tap

tap
  • get/sets the status of Tap button

Type: 
  • boolean

Values:

  • 1 = True = Tap button enabled
  • 0 = False = Tap button isn't enabled
Sensor Logic Brick: tap
  • When the sensor is activated, a positive pulse is immediately followed by a negative pulse (next frame).
Sample Code


################  get the status of the tap button

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the sensor attached to the controller
# my sensor is named Sensor_1

sen = cont.sensors["Sensor_1"]

# get the status of the tap button
status = sen.tap
 
Sample Code


################  set the status of the tap button

# import bge module
import bge

# get the controller
cont = bge.logic.getCurrentController()

# get the sensor attached to the controller
# my sensor is named Sensor_1

sen = cont.sensors["Sensor_1"]

# enable the tap button
sen.tap = True