Thread: Avatar
View Single Post
  #4  
Old 02-17-2009, 01:53 AM
DrunkenBrit DrunkenBrit is offline
Member
 
Join Date: Dec 2008
Location: England
Posts: 25
Do you have the avatar walking around? If so you'll need a keyboard callback function to control the speed, something like:

Code:
# Load avatar
myAvatar = viz.add('avatar.cfg')

# Speed of avatar
avSpeed = 1.0 

def myKeyboard(key):
  global avSpeed

  # Increase speed on key press
  if key == '+':
    avSpeed = avSpeed + 0.5
    myAvatar.speed(avSpeed)

  # Decrease speed on key press
  if key == '-':
    avSpeed = avSpeed - 0.5
    myAvatar.speed(avSpeed)

# Assign callback function to keyboard event
viz.callback(viz.KEYBOARD_EVENT,myKeyboard)
I think you'll need something like the above anyway. Hope it helps.

As for the arm hitting the baloons, sorry i'm not fully understanding what you're meaning.
Reply With Quote