Sensor Logic Brick: neg_ticks

neg_ticks
  • returns the number of ticks since the last negative pulse

Type: 
  • integer
Sample Code


################  get the number of ticks since the last negative pulse

# 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 neg_ticks
neg = sen.neg_ticks