how would i get an object to paly an ipo from one to twenty when it
collides off a wall and, play the
ipo in reverse when it collides a second time and so on?
here is what i have now
import GameLogic
g = GameLogic
cont = g.getCurrentController();
truck = cont.getOwner();
col = cont.getSensor("COL")
cneg = cont.getSensor("C_Neg")
move = cont.getActuator('move')
ipo = cont.getActuator('ipo')
fro = cont.getActuator("Fro")
bac = cont.getActuator("Bac")
if truck.Go == 1:
fro.setDRot(2.0, 0.0, 0.0, 1)
g.addActiveActuator(fro,1)
bac.setDRot(2.0, 0.0, 0.0, 1)
g.addActiveActuator(bac,1)
if truck.Loop == 0:
truck.Loop += 1
if (col.isPositive() & truck.Loop == 1):
truck.Loop += 1
ipo.setType(1)
ipo.setStart(1)
ipo.setEnd(20)
g.addActiveActuator(ipo,1)
if (col.isPositive() & truck.Loop == 2):
truck.Loop +=1
ipo.setType(1)
ipo.setStart(20)
ipo.setEnd(1)
g.addActiveActuator(ipo,1)
if cneg.isPositive():
move.setDRot(0.0, 0.0, 0.0, 0)
g.addActiveActuator(move,1)
and here is the logic brick setup
Take it easy on me I just stared python yesterrday
Thanks
Chuck