Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import bge
  2.  
  3. def main():
  4.  
  5. cont = bge.logic.getCurrentController()
  6. own = cont.owner
  7.  
  8. scene = bge.logic.getCurrentScene()
  9.  
  10. mouse = cont.sensors ["leftMouse"]
  11. getBall = cont.sensors ["getBall"]
  12. #throwBall = cont.actuators ["Throw"]
  13.  
  14. if getBall.positive:
  15. own ["balls"] = 1
  16.  
  17. #Gooi bal
  18. if (mouse.positive and own ["balls"] == 1):
  19. #cont.activate("Throw")
  20. Throw_point = scene.objects["Throw_point"]
  21. Throw_point_rotation = Throw_point.worldOrientation.to_euler()
  22. #Throw_point_rotation[2] = 0
  23.  
  24. scene.addObject("Dodgeball", Throw_point)
  25.  
  26. print(Throw_point_rotation)
  27.  
  28. dodgeball = scene.objects["Dodgeball"]
  29. dodgeball.applyRotation(Throw_point_rotation, False)
  30. print(dodgeball.worldOrientation.to_euler())
  31.  
  32. own ["balls"] = 0
  33.  
  34. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement