document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. from bge import logic
  2.  
  3. def Camera():
  4.  
  5. cont = logic.getCurrentController()
  6.  obj = cont.owner
  7.  sce = logic.getCurrentScene()
  8.  
  9.  def Init():
  10.  
  11.  if not \'init\' in obj:
  12.  
  13.  obj[\'init\'] = 1
  14.  obj[\'target\'] = sce.objects[\'Player\']
  15.  obj[\'depth\'] = obj.position.y - obj[\'target\'].position.y
  16.  
  17.  def Update():
  18.  
  19.  tarpos = obj[\'target\'].worldPosition
  20.  pos = obj.worldPosition
  21.  
  22.  soft = 1
  23.  obj.position.x += (tarpos.x - pos.x) * soft
  24.  obj.position.y += (tarpos.y + obj[\'depth\'] - pos.y) * soft
  25.  
  26.  Init()
  27.  Update()
');