Realtime ipo's

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

http://reblended.com/www/snailrose/1/1.jpg

http://reblended.com/www/snailrose/1/2.jpg

Take it easy on me I just stared python yesterrday

Thanks
Chuck

you would have the ipo actuator play in ping-pong mode. When you trigger it (and it is already playing, I forget what then, maybe nothing) it will play in the reverse of what it did before.

(I didn’t look at you logicbrick setup)

as for doing it in python you would change a property with what value you want to put the ipo at FOR THAT FRAME and do the usual GameLogic.addActiveActuator(ipoactuatororwhatever, 1)
(where ipoactuatororwhatever is your ipo actuator)