Thread: Move Objects
View Single Post
  #1  
Old 01-06-2005, 11:00 AM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
Move Objects

Hi,
I'm trying to move a ball through a room.
I know that there are certain built in functions to move it, but as I want to be very flexible I want / have to write my own movement-function.

def moveIt2():
for i in range(1,10):
print 'hallo',i
x=x0+i*0.01
y=y0+i*0,03
ball.translate(x,y,6)
i=i+1
time.sleep(0.1)

But it does not seem to work.

Without the ball.translate(x,y,6) the Function seems to work. But it prints out the numbers as a whole after in this case 1 seconds

What would you recommend for moving an object?

I know about ball.goto(3,3,6,5) or the timer-funktion-based movement. But as I want to slow down the motion sometimes (and not change speed) I will need my own timer - this is why I tried the sleep-command.

Thank you,
Johannes
Reply With Quote