#1
|
|||
|
|||
More Animations
I am still relatively new to Vizard and had a question on arrays. I have created (with some help from farshizzo) an array that holds 5 avatars.
Code:
#Create six avatars for i in range(NUM_AVATARS): newX = -math.cos(-2*i+15) * 2 newZ = math.sin(i^2+1) * 2 male = viz.add('male.cfg') male.translate(newX,0,newZ) male.rotate(180,0,0) avatars.append(male) #Save avatar in list # walkAvatar(_avatars) walk = male.walkto(0,0,-10.5,1,0,2) Code:
def mytimer(num): if num == ANIMATION: #Calculate elapsed time since last update elapsed = viz.elapsed() #Update each active ball for bullet in bullets: if bullet.active: #Move the ball and check if it has collided with any objects MoveBullet(bullet,elapsed) #Update the crosshair position crosshair.translate(viz.mousepos()+[0]) elif num == START_AVATAR: global nextAvatar #Get the next available duck and start it avatar = avatars[nextAvatar] walkAvatar(avatar) nextAvatar = (nextAvatar + 1) % NUM_AVATARS viz.starttimer(START_AVATAR,TIME_BETWEEN_AVATARS) ##Start a timer which starts the next available avatar viz.starttimer(START_AVATAR,0.01) Last edited by betancourtb82; 02-21-2006 at 10:48 AM. |
#2
|
|||
|
|||
Problem Solved, on to the next one
Ok, I solve the problem I was having yesterday by adding a
Code:
clear(viz.ALL) clear(viz.CURRENT_ACTION) Thanks |
#3
|
|||
|
|||
Hi,
The following will remove an avatar from the array: Code:
avatars.remove(male) Code:
avatars.append(male) |
Thread Tools | |
Display Modes | Rate This Thread |
|
|